From: Sarwar R. <raz...@ya...> - 2001-02-16 12:02:23
|
Hi.. I posted a similar problem a few days ago. I have tried adding the application specific jars to my classpath (referring to the jars themselves and not just their directories) but the jpyton interpreter _will not_ pick them up. The only jars cached by the package manager are those in the ..JRE/lib/ext directory. This is a serious problem for me. Any help would be much appreciated. Some additional detail: the jpython modules are run within a jpython interpreter embedded within the application. i.e. there is no CLI. I create a jpython interpreter object and pass it the name of the module to run. If any of these modules contain and 'import from' clause for a package from a jar _not_ contained witin ../JRE/lib/ext, the package manager _will not_ pick them up. I can go crazy importing java.util.Hashtable or javax.util.Timer for example, but cannot import from com.foo.bar unless foobar.jar is in ../JRE/lib/ext. I need to change this so that I can load libs from a custom directory. Thanks -Sarwar --- Jaroslav Gergic <j_g...@ya...> wrote: > Hello all, > I have the following problem with classpaths under > Tomcat: > > Short intro: > all JAR files located in $TOMCAT_HOME/lib are added > to the Java CLASSPATH and are visible to Jython. > NOTE: Their classes are loaded by the system > classloader. > > All JAR files located in an application specific lib > directory + application classes directory are > visible to > a given application. > Application specific classes located in: > $TOMCAT_HOME/webapps/myapp/WEB-INF/classes > Application spec. libraries in: > $TOMCAT_HOME/webapps/myapp/WEB-INF/lib > NOTE: application specific classes are loader using > org.apache.tomcat.loader.AdaptiveClassLoader12 (!) > > There is only oneway visibility: application classes > can > refer to classes loaded by the system classloader > but NOT vice versa. > > I have my runtime library mylib.jar located in > the application lib directory togehter with the > jython.jar > $TOMCAT_HOME/webapps/myapp/WEB-INF/lib/mylib.jar > $TOMCAT_HOME/webapps/myapp/WEB-INF/lib/jython.jar > > THE PROBLEM: > jython does not see the classes from mylib.jar, > it only creates cache for the packages found in > the standard Java classpath. (meaning > $TOMCAT_HOME/lib + JRE/lib + ...) > > How to turn jython to inlcude mylib.jar into package > cache and make mylib.jar classes accessible? > > NOTE: I can not move mylib.jar to $TOMCAT_HOME/lib > becaus mylib.jar requires access to application > specific classses. > > Thans for any hint > Gergic > > > > > > ===== > Jaroslav Gergic (Gergi) > mailto:j_g...@ya... > http://nenya.ms.mff.cuni.cz/~gergic/ > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - > only $35 > a year! http://personal.mail.yahoo.com/ > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users ===== ************************* Sarwar S Raza NMS Software Engineer CommWorks Corporation http://www.wpi.edu/~sraza ************************* __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |