From: brian z. <bz...@zi...> - 2001-02-16 13:40:08
|
Are you using the latest CVS version of jython? Finn has fixed where the jars and clases under your WEB-INF were not being found. Since the servlet container does not add the WEB-INF/* subdirs to the CLASSPATH, jython originally had no means of getting to those classes. But the patch added support to have the jython classloader look in optional directories for jar's and class'es. I have tested this under JRun with great success and I believe others have used Tomcat. Again, the latest CVS has these features so you'll have to upgrade or move the jars to another directory already added to the CP by the servlet container. hope this helps, brian -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of Sarwar Raza Sent: Friday, February 16, 2001 6:03 AM To: Jaroslav Gergic; jyt...@li... Subject: Re: [Jython-users] CLASSPATH problem under Tomcat 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/ _______________________________________________ Jython-users mailing list Jyt...@li... http://lists.sourceforge.net/lists/listinfo/jython-users |