Issue583825

classification
Title: Custom ClassLoader problem
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: bckfnn, nobody
Priority: normal Keywords:

Created on 2002-07-19.13:45:16 by anonymous, last changed 2002-09-18.14:08:03 by bckfnn.

Files
File name Uploaded Description Edit Remove
bug.jar nobody, 2002-07-19.13:45:16 test code and readme
Messages
msg691 (view) Author: Nobody/Anonymous (nobody) Date: 2002-07-19.13:45:16
There is a bug in jython when importing
a java class, under the following conditions:

1) The class is qualified, i.e. in a package
2) The class is loaded via a custom ClassLoader

If either of the above conditions are not true, the bug
does not occur.

To run the example, do the following:

- set CLASSPATH to include TestLoader.class,  but NOT
Both.jar.
- java TestLoader

TestLoader will create a URLClassLoader that loads from
Both.jar, which
contains definitions for the classes NotQual and
foo.Qual.  It will
then invoke the jython interpreter on Example.py, which
will try to
import and use both of those classes.  NotQual will
work, but foo.Qual
throws an exception:

Exception in thread "main" Traceback (innermost last):
  File "Example.py", line 4, in ?
ImportError: no module named foo
"README" [readonly] 37L, 1246C
msg692 (view) Author: Nobody/Anonymous (nobody) Date: 2002-07-19.13:50:53
Logged In: NO 

Sorry, my detailed info got cut off:  here is the rest

If you include Both.jar in the CLASSPATH, the imports will
work.

I have tried this with both 2.0 and 2.1 jython, with the
same results.

I am using the 1.3.0 IBM JVM on a Redhat 7.0 linux system,
here is the
java version information:

Java(TM) 2 Runtime Environment, Standard Edition (build
1.3.0)
Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cx130-20000815
(JIT enabled: jitc)
Rob Bjornson
bjornson@turbogenomics.com

msg693 (view) Author: Finn Bock (bckfnn) Date: 2002-09-18.14:08:03
Logged In: YES 
user_id=4201

Duplicate of #583832, closing this one.
History
Date User Action Args
2002-07-19 13:45:16anonymouscreate