tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <Simon.Kitch...@orange.ch>
Subject RE: WEB-INF/lib
Date Wed, 25 Oct 2000 16:33:47 GMT
> -----Original Message-----
> From:	TDSlusser@thoughtworks.COM [SMTP:TDSlusser@thoughtworks.COM]
> Sent:	Wednesday, October 25, 2000 4:15 PM
> To:	tomcat-user@jakarta.apache.org
> Subject:	RE: WEB-INF/lib
> 
> 
> I am doing everything according to the docs and sun spec.  But the classes
> in the jar file are unavailable.  Is there a servlet variable I can check
> at runtime to display my classpath?
> 
[Kitching Simon]  
Not that I know of, but you could try:

(a) running "jar tf jdbcfile.jar" to ensure that
the contents of the file are as expected.

(b) putting the following code in a servlet:

Class fred = Class.forName("some.class.in.jar");
if (fred == null)
  System.out("nope, couldn't load the class");
else
  System.out("class loaded....");


Just another thought: do you perhaps have
the same jar (or another jar containing classes
of the same name) in your classpath as well
as the jar in WEB-INF/lib? Having the same 
classes available from multiple locations might
cause problems..

Good luck,

Simon

>  Thanks,
> Ted.
> 
> 
>  
> 
>                     Kitching Simon
> 
>                     <Simon.Kitching@        To:
> "'tomcat-user@jakarta.apache.org'"                        
>                     orange.ch>
> <tomcat-user@jakarta.apache.org>                                  
>                                             cc:
> 
>                     10/25/2000 03:33        Subject:     RE: WEB-INF/lib
> 
>                     AM
> 
>                     Please respond
> 
>                     to tomcat-user
> 
>  
> 
>  
> 
> 
> 
> 
> Hi Ted,
> 
> This functionality works fine in tomcat3.1.
> I (and many others on this email list) use
> this without problems. I am sure that tomcat3.2
> also does this, as this behaviour is defined in
> sun's servlet specification.
> 
> The files should be in application/WEB-INF/lib.
> Tomcat *does* add these to its classpath
> automatically.
> 
> Note that only ".jar" files will be added; files
> with the suffix ".zip" get ignored. And don't
> forget that if you're using unix, then case
> is important..
> 
> Regards,
> 
> Simon
> 
> 
> > -----Original Message-----
> > From:         TDSlusser@thoughtworks.COM
> [SMTP:TDSlusser@thoughtworks.COM]
> > Sent:         Tuesday, October 24, 2000 9:17 PM
> > To:           tomcat-user@jakarta.apache.org
> > Subject:           WEB-INF/lib
> >
> > Hi All,
> >
> > I am trying to put my JDBC jar file in the application/WEB-INF/lib
> > directory but Tomcat doesn't add the jar file to its classpath
> > automatically.  Is there a config parameter in one of the xml files to
> do
> > this?  Also the default "build" script for NT machines says to put the
> > jars
> > in application/lib instead of application/WEB-INF/lib.  I tried it both
> > ways and it doesn't work.  I am restarting the server after ant copies
> the
> > files to the appropriate directories.
> >
> > If I add the jar file to the CLASSPATH in the script to start the tomcat
> > server it works, but I thought it was supposed to happen automatically.
> >
> >
> > Thanks,
> > Ted.
> 
> 
> 

Mime
View raw message