You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew Jarman <aj...@metacomcorp.com> on 2000/08/05 01:08:47 UTC

Can't find jars in webapps/WEB-INF/lib

Hi,

This seems like a really stupid question, but I've been fighting it for
hours:

I have put together a servlet, along with some required jar files into
the following dir structure:

ROOT/WEB-INF/lib/*.jar
ROOT/WEB-INF/web.xml

The lib/*.jar includes the servlet classes and some other associated
classes.  This includes the vbjorb.jar and others so my servlet can
access an oracle database.

When I try to load the servlet this way, by servlet starts initializing
(so I know that the servlet jar file was found), but the init() function
fails because it can't load all the necessary classes.

If I copy all of the jar files to the /tomcat/lib directory and restart
tomcat, everything works fine.

All of the docs seem to indicate that jar files placed in the
WEB-INF/lib directory would be added to the CLASSPATH for the
application.

What am I doing wrong?

Assuming somebody helps me figure this out, can I also put .zip files in
the WEB-INF/lib dir?  (for example, classes12.zip for Oracle)

Cheers,
Andrew


Re: Can't find jars in webapps/WEB-INF/lib

Posted by Jakob Hummes <hu...@castify.net>.
Same problem here.  I use also the same workaround (copying the zip for
Oracle under /tomcat/lib).

My config is: Win 2000 (but also tried under Win NT and Linux); Sun JDK
1.2.2 with JIT enabled; Tomcat 3.1 ).

- Jakob

Andrew Jarman wrote:
> 
> Hi,
> 
> This seems like a really stupid question, but I've been fighting it for
> hours:
> 
> I have put together a servlet, along with some required jar files into
> the following dir structure:
> 
> ROOT/WEB-INF/lib/*.jar
> ROOT/WEB-INF/web.xml
> 
> The lib/*.jar includes the servlet classes and some other associated
> classes.  This includes the vbjorb.jar and others so my servlet can
> access an oracle database.
> 
> When I try to load the servlet this way, by servlet starts initializing
> (so I know that the servlet jar file was found), but the init() function
> fails because it can't load all the necessary classes.
> 
> If I copy all of the jar files to the /tomcat/lib directory and restart
> tomcat, everything works fine.
> 
> All of the docs seem to indicate that jar files placed in the
> WEB-INF/lib directory would be added to the CLASSPATH for the
> application.
> 
> What am I doing wrong?
> 
> Assuming somebody helps me figure this out, can I also put .zip files in
> the WEB-INF/lib dir?  (for example, classes12.zip for Oracle)
> 
> Cheers,
> Andrew

Re: Can't find jars in webapps/WEB-INF/lib

Posted by Jason Rumney <jr...@att.com>.
Andrew Jarman <aj...@metacomcorp.com> writes:

> Hi,
> 
> This seems like a really stupid question, but I've been fighting it for
> hours:
> 
> I have put together a servlet, along with some required jar files into
> the following dir structure:
> 
> ROOT/WEB-INF/lib/*.jar
> ROOT/WEB-INF/web.xml
> 
> The lib/*.jar includes the servlet classes and some other associated
> classes.  This includes the vbjorb.jar and others so my servlet can
> access an oracle database.

vbjorb.jar contains classes that need to override the org.omg.corba.*
classes that are part of the standard Java libraries. Because of this,
it does not work when placed in an application specific lib
directory. There may be a similar problem with the oracle.jar (I have
no experience with this one).



-- 
Jason Rumney <jr...@att.com>
AT&T Labs (Redditch, UK)


RE: Can't find jars in webapps/WEB-INF/lib

Posted by Michael Dowling <mi...@e-acumen.com>.
There *has* to be a bug in the classloader.  This is the 3rd guy (including
myself) that has posted a similar bug...



thanks, mdd



--
Michael D. Dowling
V.P. Technology, e-Acumen
michael@e-acumen.com
415-255-2250, 415-613-4959 cell.
1940 Bryant Street, San Francisco, CA 94110


> -----Original Message-----
> From: Andrew Jarman [mailto:ajarman@metacomcorp.com]
> Sent: Friday, August 04, 2000 4:09 PM
> To: Tomcat User (E-mail)
> Subject: Can't find jars in webapps/WEB-INF/lib
>
>
> Hi,
>
> This seems like a really stupid question, but I've been fighting it for
> hours:
>
> I have put together a servlet, along with some required jar files into
> the following dir structure:
>
> ROOT/WEB-INF/lib/*.jar
> ROOT/WEB-INF/web.xml
>
> The lib/*.jar includes the servlet classes and some other associated
> classes.  This includes the vbjorb.jar and others so my servlet can
> access an oracle database.
>
> When I try to load the servlet this way, by servlet starts initializing
> (so I know that the servlet jar file was found), but the init() function
> fails because it can't load all the necessary classes.
>
> If I copy all of the jar files to the /tomcat/lib directory and restart
> tomcat, everything works fine.
>
> All of the docs seem to indicate that jar files placed in the
> WEB-INF/lib directory would be added to the CLASSPATH for the
> application.
>
> What am I doing wrong?
>
> Assuming somebody helps me figure this out, can I also put .zip files in
> the WEB-INF/lib dir?  (for example, classes12.zip for Oracle)
>
> Cheers,
> Andrew
>
>