From: Vladimir B. <vla...@gm...> - 2004-10-05 12:01:45
|
Hi, we have decided to go for a Tomcat extended with a custom jython tag (as described at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252132) , but we are having problems with the jython imports and Tomcat CLASSPATH. The class that invokes the jython interpreter (custom tag) sees all the web application libraries (e.g. jython.jar), but when the interpreter tries to load an imported java class from a jar from the included libraries, it does not find them. Any ideas? We saw that if before we create the interpreter we call PythonInterpreter.initialize, where we pass "java.class.path=$webapp_classpath" with the first Properties parameters, the interpreter finds libraries listed under the $webapp_classpath. We temporarily solved it by hard coding our class path in there We can not find a (nice) way to get the webapp libraries from within the code. Any suggestions are appreciated. Cheers, Vladimir |
From: Vladimir B. <vla...@gm...> - 2004-10-05 15:00:14
|
> Are you setting your classpath environment variable? Nope. We can verify though that the class paths are correctly set for our webapp (include WEB-INF/lib for example). I suspect that jython interpreter is not using the webapp class loader as a parent class loader (because if we query that one, we see that it knows about all the classes). The funny thing is that it can not even find the standard java classes, like java.lang.String. If we do exactly the same outside Tomcat (create interpreter and evaluate some jython code that imports stuff) it works. On Tue, 05 Oct 2004 10:41:53 -0400, Todd Moyer <tm...@in...> wrote: > > Are you setting your classpath environment variable? > > Todd > > > > > Vladimir Blagojevic wrote: > > > Hi, > > > > we have decided to go for a Tomcat extended with a custom jython tag > > (as described at > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252132) , but > > we are having problems with the jython imports and Tomcat CLASSPATH. > > > > The class that invokes the jython interpreter (custom tag) sees all > > the web application libraries (e.g. jython.jar), but when the > > interpreter tries to load an imported java class from a jar from the > > included libraries, it does not find them. > > > > Any ideas? > > > > We saw that if before we create the interpreter we call > > PythonInterpreter.initialize, where we pass > > "java.class.path=$webapp_classpath" with the first Properties > > parameters, the interpreter finds libraries listed under the > > $webapp_classpath. We temporarily solved it by hard coding our class > > path in there > > > > We can not find a (nice) way to get the webapp libraries from within the code. > > > > Any suggestions are appreciated. > > > > Cheers, > > Vladimir > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > > Use IT products in your business? Tell us what you think of them. Give us > > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > > http://productguide.itmanagersjournal.com/guidepromo.tmpl > > _______________________________________________ > > Jython-users mailing list > > Jyt...@li... > > https://lists.sourceforge.net/lists/listinfo/jython-users > > |
From: Alan K. <jyt...@xh...> - 2004-10-05 16:49:50
|
[Vladimir Blagojevic] >we have decided to go for a Tomcat extended with a custom jython tag >(as described at >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252132) , but >we are having problems with the jython imports and Tomcat CLASSPATH. Just a quick check: have you tried different locations in the classloader hierarchy for your jars? Although you may only be using your tag-libs in a certain application, the tag-libs might also need to be accessible to the JSP compiler, which is at a higher level in the classloader hierarchy. See here for more info http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html A trial-and-error process of placing your archives in each of the several levels identified above should quickly tell you if this is the problem. Regards, Alan. |