Jython says: “There are no visible constructors for the class”

I have a jython servlet as part of a large application running in tomcat5. I tested several Spring Framework classes and created objects in the Jython servlet. When I try to create class objects in the application, I will catch a message about the exception "There are no visible constructors for the class." These Java classes have a public constructor class, for example:

public SchoolImpl() { }

I create an object in python:

from com.dc.sports.entity import SchoolImpl

...

school = SchoolImpl()

What am I doing wrong?

+5
source share
1 answer

doublep / cluch answered the question :-) in the comment

adding some info:

From the Jython FAQ:

3.3 Java 'protected' 'private' Java 'protected' 'private' Java?

, Java, . Java python.security.respectJavaAccessibility:

# Setting this to false will allow Jython to provide access to
# non-public fields, methods, and constructors of Java objects.
python.security.respectJavaAccessibility = false
+3

All Articles