From: Robert D. <rdi...@tr...> - 2003-10-16 19:29:15
|
Well, I'm using URLClassLoader which should delegate to the parent. I construct with the parent at least. Even if the classes where available, wouldn't I still have to do something with the packageManager in Jython to support modules? -----Original Message----- From: George Rogers [mailto:gr...@so...]=20 Sent: Thursday, October 16, 2003 7:07 AM To: jyt...@li... Subject: Re: [Jython-users] Jython, Modules, and ClassLoading I think you have run into a "feature" of the Java Language=20 definition. Separate instances of any class loader object (whether or not the instances are of the same class or are in the same class hierarcy) do not share the set of classes they have=20 loaded. You need to ensure that your loader is searching the parent class loader (as=20 provided to the alternate ClassLoader constructor) as well as its own internal list of classes. Make=20 sure you are not assuming "parent" in the inheritance sense but in the ClassLoader=20 delegation sense. George Rogers At 05:25 PM 10/15/03 -0700, Robert DiFalco wrote: >I put the Jython Interpreter in it's own classloader so that I can=20 >reconstruct it in a new classloader if I detect that my scripts have=20 >changed. The parent classloader happens to be an URLClassLoader. > >The problem I have is that if I don't parse all my class annotations=20 >and add them one by one to the=20 >Py.getSystemState().packageManager.addJarToPackages( URL ) I get a "No=20 >module named core" exception on an import line like so: > > from com.tripwire.core import CoreException > >I guess the solution is to do this, but it seems odd because it=20 >re-requests every jar in my system from my CodeBase Server even though=20 >those jars are already present in the Parent classloader. > >Thoughts? > >R. > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program.=20 >SourceForge.net hosts over 70,000 Open Source Projects. See the people=20 >who have HELPED US provide better services: Click here:=20 >http://sourceforge.net/supporters.php >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |