« Return to Thread: classpath, JRuby, and Tomcat

Re: classpath, JRuby, and Tomcat

by Lenny Marks :: Rate this Message:

Reply to Author | View in Thread

Tomcat has its own set of class loaders so java.class.path doesn't  
really apply fully.

http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

If you are trying to load classes/resources in WEB-INF/lib via one of  
the classloaders other than the WebApp class loader(e.g from a class  
in a jar not in WEB-INF/lib), I think you will have problems.

-lenny

On Mar 4, 2008, at 5:13 PM, John Woodward wrote:

> I have a JRuby 1.1RC2 application, with Rails 2.0.2, almost ready  
> to deploy. I've built a war file with warbler. Configuration of  
> warbler is very vanilla, as is my dev installation of tomcat.
>
> The problem that I"m having is that the application relies on a set  
> of jar files; all the required jar files are in lib (and so I've  
> confirmed that they are packaged properly in WEB-INF/lib).  
> Unfortunately, they don't appear to be being added to the classpath  
> of the running webapp. An inspection of the property  
> java.class.path shows only a few tomcat related jar files in the  
> classpath; the library I'm using also fails miserably when it  
> searches for resources amongst it's jar files.
>
> In a standalone mode, with test code, everything works fine as long  
> as I set CLASSPATH to contain all the relevant jar files. Without  
> setting the classpath (despite any require or load statements I may  
> have), the app fails miserably; the failure is the same as when  
> running under tomcat.
>
> Is there something I'm missing? Should the jars show up in the  
> property java.class.path?
>
> Thanks!
>
> john


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: classpath, JRuby, and Tomcat