Message3984
Jython doesn't use Thread.currentThread().getContextClassLoader() when
importing Java classes from Python code. So, if Jython itself lives in
a 'small' classpath that cannot see the main code classes, the classes
will not be importable from Python code, at least not without extra
black magick.
Using the thread-context class path is a common idiom used by many
libraries that can dynamically load user classes.
Problems with class loaders are typical to web application, especially
large. They often have convoluted hierarchy of class loaders. E.g. I
have something like this:
.... < Class loader X < ... < Main class loader
Jython is visible to X, while main classes become visible only to
higher-level class loader 'Main'. So, currently Jython simply doesn't
see the application classes and fails to import them.
The attached patch does solve my problem. |
|
Date |
User |
Action |
Args |
2008-12-29 15:01:39 | doublep | set | recipients:
+ doublep |
2008-12-29 15:01:35 | doublep | set | messageid: <1230562895.56.0.496372949736.issue1216@psf.upfronthosting.co.za> |
2008-12-29 15:01:34 | doublep | link | issue1216 messages |
2008-12-29 15:01:34 | doublep | create | |
|