Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 32551 invoked from network); 1 Jun 2000 16:07:38 -0000 Received: from threshold3.jpmorgan.com (HELO jpmorgan.com) (169.71.1.12) by locus.apache.org with SMTP; 1 Jun 2000 16:07:38 -0000 Received: (from uucp@localhost) by jpmorgan.com (8.8.5/8.8.5) id MAA16585 for ; Thu, 1 Jun 2000 12:07:37 -0400 (EDT) Received: from jpmmailhost4.ny.jpmorgan.com(198.75.231.102) by threshold3.jpmorgan.com via smap (V4.2) id xma016569; Thu, 1 Jun 00 12:07:35 -0400 Received: from nyc-ntgw-n01.ny.jpmorgan.com (nyc_smtpmta_02.ny.jpmorgan.com [146.149.150.22]) by jpmmailhost4.ny.jpmorgan.com (8.9.1a/8.9.1) with SMTP id MAA06924 for ; Thu, 1 Jun 2000 12:07:35 -0400 (EDT) Received: by nyc-ntgw-n01.ny.jpmorgan.com(Lotus SMTP MTA v4.6.4 (830.2 3-23-1999)) id 852568F1.005893E4 ; Thu, 1 Jun 2000 12:07:30 -0400 X-Lotus-FromDomain: JPMORGAN@SMTP From: "Ken X Horn" To: tomcat-dev@jakarta.apache.org Message-ID: <852568F1.005892C7.00@nyc-ntgw-n01.ny.jpmorgan.com> Date: Thu, 1 Jun 2000 17:06:48 +0100 Subject: Re: WEB-INF/lib and .jar files in Tomcat 3.1 Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N The reason the system classes are loaded first normally, is that the CLASSPATH loaded files are "trusted" by the JVM. Those from a ClassLoader should not normally be able to 'redefine' already loaded classes- this leads to ClassCastExceptions - identical classes loaded from different loaders cannot even be assigned to each other. On a CORBA specific - the ORB.init(props, args) call changed in 2.1 (2.2?) so that you can specify the class to use - I think it was for this very reason, previously you had to load ORB classes before the JDK.. but that's a bit of a hack (IMHO), you shouldn't have to worry about it. Make sure you're not using the orb.init() call with no params - this is a singleton orb, which behaves quite differently. Which ORB are you using? Ken Craig.McClanahan@eng.sun.com on 01/06/2000 11:09:29 Please respond to tomcat-dev@jakarta.apache.org To: tomcat-user@jakarta.apache.org cc: tomcat-dev@jakarta.apache.org (bcc: Ken X Horn) Subject: Re: WEB-INF/lib and .jar files in Tomcat 3.1 Jason Rumney wrote: > Nacho writes: > > > I think that there are no restrictions to this, only that zip files are > > no loaded from WEB-INF/lib, but a zip file is not jar :-). > > > > > > > The reason I ask is that the CORBA libraries required by myapp do not > > > appear to be loaded from myapp/WEB-INF/lib. I wonder whether they are > > > too low-level for this method to work. > > > > > > > i dont know, but until now everytime i have the feeling that tomcat > > don't load a file from WEB-INF/lib was my fail no a Tomcat's fail..... > > Thanks for confirming that this should work, and I am not reading the > servlet spec wrong. > > The files are jar files, and they are in WEB-INF/lib, not a > subdirectory. Permissions are 664, so Tomcat should have no problems > reading them. They are loaded if I place them in jakarta-tomcat/lib, > but for reasons of organization I would prefer to keep them with the > app rather than the server. > > The only thing I can think of is that these libraries contain > org.omg.CORBA.* classes, so they may need to be loaded when the JVM > starts up, to avoid clashes with the standard Java 1.2 classes. I don't > know enough about the Java classloader to know whether this would be > an issue, or if there is another problem. > That is going to be an issue. As currently implemented, the class loader used by Tomcat looks on the system classpath first, and then into the application-specific stuff (WEB-INF/classes and WEB-INF/lib/*.jar). Thus, the classes from the JDK are going to be found where they have the same name, but the ones from your library will be found when they are different -- a mix that probably isn't going to work. IMHO the class loader logic should be reversed - load from the application repositories first and then the system classpath. I'm cross posting this to the developer's list in order to discuss this further. > > -- > Jason Rumney > AT&T Labs (Redditch, UK) Craig McClanahan --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of J.P. Morgan & Co. Incorporated, its subsidiaries and affiliates.