tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmanola...@yahoo.com
Subject RE: FW: Any known issues with Tomcat 3.2.1 and class loading ?
Date Wed, 09 May 2001 22:52:12 GMT

One possible problem may be the fact that by default, tomcat3.2.1 doesn't
set the context class loader ( a JDK1.2 feature ). 

Just add Jdk12Interceptor in server.xml 
 <RequestInterceptor
            className="org.apache.tomcat.request.Jdk12Interceptor" />


( the default config assumes JDK1.1. In tomcat3.3 we detect the VM and 
add the interceptor automatically, but this feature hasn't been
backported).

Alternatively, you could call the Thread.setContextLoader() in your code,
passing the loader that was used for your servlet ( jndi and some other
classes need something like that ).

Costin


On Wed, 9 May 2001, Gudmundur Hafsteinsson wrote:

> Before answering your question, two things:
> - This is a user question, please use the tomcat-user list,
>   this list is for development of Tomcat.
> - Don't send HTML mails to the list.
> 
> Now regarding your problem, this is probably the typical
> classloader problem so many run into.
> If the code which is instantiating the class was loaded
> using the classpath classloader it won't be able to access
> jar files in the WEB-INF/lib folder. For more info on the
> hierarchy of class loader see Java documentation and
> browse through the tomcat-dev list archives.
> 
> You have to make sure that none of the classes you are
> putting into WEB-INF/lib is also in the lib folder
> of Tomcat, because that classloader has higher priority
> resulting in the wrong class being loaded.
> Also make sure none of the classes is in the lib/ext
> folder of the virtual machine, since that one has even
> higher priority over the other classloaders.
> 
> Also make sure that none of the classes in the Tomcat
> lib folder is being used to instantiate the classes
> you need (that is a class in the Tomcat lib folder
> is invoked to create an object who's class type is
> in the WEB-INF/lib folder; it won't find it).
> 
> I hope this is clear enough.
> 
> As far as I can see from the discussion on this list
> this will be mostly fixed in the 3.3 version of Tomcat
> by having a special isolated classloader for the servlet
> engine, and this problem should also be non-existent
> in Catalina (4.0) for the same reason.
> 
> Gummi Haf
> 
> -----Original Message-----
> From: Hawkins, Keith (Keith) [mailto:kphawkins@avaya.com]
> Sent: 9. maĆ­ 2001 19:10
> To: tomcat-dev@jakarta.apache.org
> Subject: RE: FW: Any known issues with Tomcat 3.2.1 and class loading ?
> 
> 
> No, they are not .zip files.  They are .jar files.  Specifically 
> jndi.jar, ldap.jar and providerutil.jar, which are provided by 
> Sun for accessing LDAP databases via JNDI.    I was able to 
> get the Tomcat to load these classes but only by editing the 
> wrapper.class_path property in the wrapper.properties config file. 
> But I was under the impression that simply putting the Sun jar 
> files in the WEB-INF/lib directory along with my servlet.jar file 
> would be sufficient and eliminate the need to edit wrapper.properties. 
> Am I off base here?  Is there some limitation to having more than one 
> jar file in WEB-INF/lib? 
> -Keith 
> 
> 
> 
> -----Original Message----- 
> From: Kellie Miller [mailto:Kellie.Miller@boeing.com] 
> Sent: Wednesday, May 09, 2001 2:15 PM 
> To: tomcat-dev@jakarta.apache.org 
> Subject: Re: FW: Any known issues with Tomcat 3.2.1 and class loading ? 
> 
> 
> I have had some success with renaming .zip files .jar (your mileage may
> vary). 
> cheers, 
> Kellie 
> >-----Original Message----- 
> >From: Wildeboer, Tonnis [mailto:twildebo@Covad.COM] 
> >Sent: Wednesday, May 09, 2001 12:05 PM 
> >To: 'tomcat-dev@jakarta.apache.org' 
> >Subject: RE: Any known issues with Tomcat 3.2.1 and class loading ? 
> > 
> >If they are .zip files you'll have to add them to the CLASSPATH yourself.
> 
> > 
> >--Tonnis 
> >-----Original Message----- 
> >From: Hawkins, Keith (Keith) [mailto:kphawkins@avaya.com] 
> >Sent: Wednesday, May 09, 2001 8:24 AM 
> >To: tomcat-dev@jakarta.apache.org 
> >Subject: Any known issues with Tomcat 3.2.1 and class loading ? 
> > 
> > 
> >Dear Developers: 
> > 
> >Are there any known issues with class loading under Tomcat 3.2.1? 
> > 
> >My situation is that classes in jar files that reside in the WEB-INF/lib 
> >directory for my servlet fail to load when accessed under Tomcat.  Yet
> the 
> >classes load fine when accessed via test programs that use the very same 
> >jar files and call the same servlet methods. 
> > 
> >Seems like Tomcat is not working as advertised with respect to 
> >automatically adding jar files from  <servletdir>/WEB-INF/lib to the
> classpath. 
> > 
> >Can anyone confirm whether this is a known issue? 
> > 
> >Thanks, 
> >Keith 
> Kellie Miller, Advanced Computing Technologist 
> Boeing PhantomWorks, Math & Computing Technology, Huntsville Center 
> Email: Kellie.Miller@boeing.com Phone: 256-461-2604 Fax: 256-461-3239 
> Post: PO Box 240002, MC JW-75, Huntsville, AL 35824-6402 
> 


Mime
View raw message