[ Isabelle Therrien ]
> I am running embedded java from a utility class in a J2EE application
> running on Weblogic 6.1.
> The interpreter is running ok, but if I try to import java classes
> within the EAR file or even from the weblogic CLASSPATH (system
> java.class.path), it cannot find them. I printed the property
> "java.class.path", and the jar file to look in is really there.
> I initialize the system state before instanciation of the interpreter
> (where props contains properties like "python.path")
> PySystemState.initialize(System.getProperties(), props, new
> Work-around: Adding the directory where my jar files are to the
> "SystemState" solved the problem:
> // before instanciation of the interpreter
> for rt.jar
> PySystemState.add_extdir("/.../Projets/gnp2/lib"); //
> for my own java classes.
> But the instanciation of the interpreter takes a very long time
> 20 seconds), which is not acceptable for my application.
> Someone knows what should I do?
that is exactly what I was facing, too.
Another workaround: use .add_package() instead of add_extdir().
Disadvantage of this: you have to add every package.
You have 2 other choices:
1) wait until Jython 2.x solves it
2) use my two patches (against Jython 2.1):
- 'disable package scan' (on sourceforge)
(see attached .zip file)
The name of the second (simple java class import) is a bit misleading:
It enables 'natural' import from the classpath, just as you would
expect. Although Samuele did not like the implementation details and it
is therefore not officially approved, it works fine in our J2EE
I hope this was not too confusing.
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free