tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amos Shapira <amos.shap...@webcollage.com>
Subject RE: Class Loadting in WEB-INF/lib not working?
Date Thu, 13 Jul 2000 15:13:50 GMT
Hi,

Not being a class-loader expert, but maybe such code (which uses reflection
to find classes) should make sure it uses the right class loader? 
(e.g. the one which was used to load the calling class or calling servlet?)

Cheers,

--Amos Shapira
WebCollage

> -----Original Message-----
> From: Serrano, Miguel (AT-Atlanta) 
> [mailto:Miguel.Serrano@AutoTrader.com]
> Sent: Thursday, July 13, 2000 5:59 PM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: Class Loadting in WEB-INF/lib not working?
> 
> 
> I found this problem (feature?) also.
> 
> If any your classes uses Class.forName() and/or other dynamic instance
> handling techniques, you need to add your webApp jar to the Tomcat
> classpath. Otherwise the ClassLoader won't be able to find them.
> 
> Hope this helps.
> 
> -----Original Message-----
> From: Paul Libbrecht [mailto:paul@ags.uni-sb.de]
> Sent: Thursday, July 13, 2000 10:52 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Class Loadting in WEB-INF/lib not working?
> 
> 
> I think I had that one already some time ago... Can't comment 
> much more...
> 
> Paul
> 
> 
> At 7:34 AM -0700 7/13/00, Michael Dowling wrote:
> >Hey all --
> >
> >I deployed a WAR file to tomcat's webapps dir, and 
> configured server.xml to
> >point to that war.  Tomcat starts up, expands the war file, 
> and (most)
> pages
> >work.
> >
> >However, one of the pages uses a SettingsData class.  When I 
> access that
> >page, I get a NoCLassDefFound exception for
> >com/eacumen/acupower/setting/SettingsData.
> >
> >So, I go to the WEB-INF/lib directory, and:
> >
> >[michael@dev bin]$ jar tvf com.eacumen.acupower.setting.jar
> >      0 Sun Jul 09 15:02:12 PDT 2000 META-INF/
> >     68 Sun Jul 09 15:02:12 PDT 2000 META-INF/MANIFEST.MF
> >      0 Sun Jul 09 15:02:08 PDT 2000 com/eacumen/acupower/setting/
> >    855 Sun Jul 09 15:01:54 PDT 2000
> >com/eacumen/acupower/setting/SettingsDataArea.class
> >
> >	[...snip...]
> >
> >  19720 Sun Jul 09 15:02:06 PDT 2000
> >com/eacumen/acupower/setting/SettingsData.class
> >  18700 Sun Jul 09 15:02:08 PDT 2000
> >com/eacumen/acupower/setting/SettingManager.class
> >
> >
> >It's in the jar file!  (we have multiple jar files in /lib/, btw).
> >
> >Perplexed, I finally tried just un-jarring the .jar files into
> >WEB-INF/classes.  Guess what?  it worked...
> >
> >Is this a known tomcat bug, or am I incorrectly assuming 
> that tomcat reads
> >in ALL jar files in it's /lib/ directory?
> >
> >thanks, mdd
> 

Mime
View raw message