BUG? TC 5.0.xx: WEB-INF/classes/jndi.properties found but INITIAL_CONTEXT_FACTORY property gets overwritten by TC [Auf Viren geprüft]
Task: = I want to use LdapContext lctx = new InitialLdapContext(); that is InitialLdapContext without environment parameters. My understanding of J2EE standards is that the servlet container tries to find the file jndi.properties on the application classpath and if found initializes the context environment with properties from there. Problem: Ldap operations on lctx fail with exception: javax.naming.NotContextException: Not an instance of DirContext Cause: == The property in jndi.properties: java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory gets overwritten by Tomcat and is aquivalent to java.naming.factory.initial= org.apache.naming.java.javaURLContextFactory I've written a small web application to prove it and I read a property from that file as follows: com.example.test.key=42 This value is available in the web-application as String testValue = (String) lctx.getEnvironment().get( com.example.test.key); which is 42. So jndi.properties are found by the classloader(?) and evaluated. Workaround: === I read my LDAP connection environment properties from my own properties file. But I want to use the JNDI standard way! Bugfix: == Find and change the lines where java.naming.factory.initial gets overwritten with Tomcats own value org.apache.naming.java.javaURLContextFactory If this is a real bug I would take it to the developers list or bugzilla. Here is my Testclass: package com.example; import javax.naming.*; import javax.naming.directory.*; import javax.naming.ldap.*; /** * Test the JNDI Implementation of Tomcat (5.0.x). * Connect to LDAP and search person objects * Demonstrate failure to read INITIAL_CONTEXT_FACTORY property from file jndi.properties * * @author Frerk.Meyer(at)edeka.de * */ public class JNDITest { static public void testInitialLdapContext() throws NamingException { // get initial ldap context with environment from jndi.properties LdapContext lctx = new InitialLdapContext(); // check if key INITIAL_CONTEXT_FACTORY has the value from jndi.properties String contextFactory = (String) lctx.getEnvironment ().get(Context.INITIAL_CONTEXT_FACTORY); // if not print out the false value if (!contextFactory.equals(com.sun.jndi.ldap.LdapCtxFactory)) { System.out.println(INITIAL_CONTEXT_FACTORY= +contextFactory); System.err.println(INITIAL_CONTEXT_FACTORY= +contextFactory); } // check if my jndi.properties was read with arbitrary key-value-pair String testValue = (String) lctx.getEnvironment().get( com.example.test.key); if (testValue!= null) { System.out.println(com.example.test.key= +testValue); System.err.println(com.example.test.key= +testValue); } // do some typical ldap search for person objects SearchControls sc = new SearchControls(); sc.setSearchScope(SearchControls.SUBTREE_SCOPE); sc.setTimeLimit(1000); sc.setCountLimit(100); sc.setReturningAttributes(null); NamingEnumeration results = lctx.search(, (objectclass=inetorgperson),sc); while (results.hasMoreElements()) { SearchResult result = (SearchResult) results.nextElement (); String name = (String) result.getName(); System.out.println(name+\nbr\n); } results.close(); lctx.close(); } } Here it is called from within a JSP: %@ page import=com.example.JNDITest,javax.naming.NamingException % html head titleJNDITest for Tomcat/title /head body h1JNDITest for Tomcat/h1 p % try { JNDITest.testInitialLdapContext(); } catch (NamingException ne) { out.println(NamingException in testInitialLdapContext: br / +ne.toString()); } % /p /body /html And here is my jndi.properties (change to apply to your LDAP server): # jndi.properties for LDAP java.naming.provider.url=ldap://webas01.zentrale.edekanet.de:389/o=Prod,dc=edekanet,dc=de java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory java.naming.factory.object=com.sun.jndi.ldap.obj.LdapGroupFactory java.naming.factory.state=com.sun.jndi.ldap.obj.LdapGroupFactory java.naming.security.authentication=none java.naming.ldap.version=3 #java.naming.factory.url.pkgs=com.sun.jndi.url.ldap com.example.test.key=42 Frerk Meyer EDEKA Aktiengesellschaft GB Datenverarbeitung Frerk Meyer CC Web Technologien New-York-Ring 6 22297 Hamburg Tel: 040/6377 - 3272 Fax: 040/6377 - 41268 mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: BUG? TC 5.0.xx: WEB-INF/classes/jndi.properties found but INITIAL_CONTEXT_FACTORY property gets overwritten by TC [Auf Viren geprüft]
Hi, My understanding of J2EE standards is that the servlet container tries to find the file jndi.properties on the application classpath and if found initializes the context environment with properties from there. I don't think this understanding is correct for containers and J2EE servers. IIRC you have to use the InitialContext construct with the env argument which has the initial context factory class name. Yoav This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: BUG? TC 5.0.xx: WEB-INF/classes/jndi.properties found but INITIAL_CONTEXT_FACTORY property gets overwritten by TC [Auf Viren geprüft]
Dear Yoav, My understanding of J2EE standards is that the servlet container tries to find the file jndi.properties on the application classpath and if found initializes the context environment with properties from there. I don't think this understanding is correct for containers and J2EE servers. IIRC you have to use the InitialContext construct with the env argument which has the initial context factory class name. 1. Tomcat (5.0.28,5.0.29beta) does search the jndi.properties on the application classpath and finds it, since: 2. It reads my com.example.test.key=42 property 3. It reads my java.naming.factory.object=com.sun.jndi.ldap.obj.LdapGroupFactory property which does not get overwritten 4. Therefore I guess it reads my java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory property too, but replaces it with org.apache.naming.java.javaURLContextFactory, I presume for internal use and doesn't set it back to original. 5. If it finds two or more factories, specs say that they are to be concatenated by colons (':'), and not - in contrast to the other properties - just take the first one. http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/InitialContext.html 6. It does not throw a NoInitialContextException, even thought InitialLdapContext(); is implemented as InitialLdapContext(null,null); so it gets some Context from somewhere: (ctx instanceof DirContext) even equals true! So it tries to behave like I think it should behave, but fails due to what I call a bug. If it was illegal, it should give me an exception like NoInitialContextException, when I call InitialLdapContext(). I would like to have a reference to a standards document where it says that there is an exception for containers and J2EE servers. I've searched this topic up and down the web and haven't found an exception. Instead Sun's Tutorial says: http://java.sun.com/products/jndi/tutorial/beyond/env/context.html So the environment, effectively, is the union of the environment parameter and all application resource files, with the additional rule that some standard properties could be gotten from applet parameters or system properties. This topic was already discussed in 2001 for Tomcat 3.x on [EMAIL PROTECTED] but coming not to a solution, only a workaround: http://archives.java.sun.com/cgi-bin/wa?A2=ind0107L=jndi-interestF=S =P=2069 Since Tomcat is the reference implementation (of the spec) I would like to have a behavior according to the spec or a clarificaton of it. And I want to specify my basic LDAP connection properties only in one place with inheritance for many webapps and overriding some properties if needed in application specific jndi.properties. Application specific property files cannot do that. Many thanks for thinking about this one. Frerk Meyer EDEKA Aktiengesellschaft GB Datenverarbeitung Frerk Meyer CC Web Technologien New-York-Ring 6 22297 Hamburg Tel: 040/6377 - 3272 Fax: 040/6377 - 41268 mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: BUG? TC 5.0.xx: WEB-INF/classes/jndi.properties found but INITIAL_CONTEXT_FACTORY property gets overwritten by TC [Auf Viren geprüft]
Hi, OK. Feel free to file a Bugzilla issue if you'd like. If you have a .diff patch you'd like to send along, that'd be great, and it will also improve the chances of someone looking at this. Yoav Shapira http://www.yoavshapira.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 27, 2004 11:04 AM To: Tomcat Users List Subject: RE: BUG? TC 5.0.xx: WEB-INF/classes/jndi.properties found but INITIAL_CONTEXT_FACTORY property gets overwritten by TC [Auf Viren geprüft] Dear Yoav, My understanding of J2EE standards is that the servlet container tries to find the file jndi.properties on the application classpath and if found initializes the context environment with properties from there. I don't think this understanding is correct for containers and J2EE servers. IIRC you have to use the InitialContext construct with the env argument which has the initial context factory class name. 1. Tomcat (5.0.28,5.0.29beta) does search the jndi.properties on the application classpath and finds it, since: 2. It reads my com.example.test.key=42 property 3. It reads my java.naming.factory.object=com.sun.jndi.ldap.obj.LdapGroupFactory property which does not get overwritten 4. Therefore I guess it reads my java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory property too, but replaces it with org.apache.naming.java.javaURLContextFactory, I presume for internal use and doesn't set it back to original. 5. If it finds two or more factories, specs say that they are to be concatenated by colons (':'), and not - in contrast to the other properties - just take the first one. http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/InitialContext.html 6. It does not throw a NoInitialContextException, even thought InitialLdapContext(); is implemented as InitialLdapContext(null,null); so it gets some Context from somewhere: (ctx instanceof DirContext) even equals true! So it tries to behave like I think it should behave, but fails due to what I call a bug. If it was illegal, it should give me an exception like NoInitialContextException, when I call InitialLdapContext(). I would like to have a reference to a standards document where it says that there is an exception for containers and J2EE servers. I've searched this topic up and down the web and haven't found an exception. Instead Sun's Tutorial says: http://java.sun.com/products/jndi/tutorial/beyond/env/context.html So the environment, effectively, is the union of the environment parameter and all application resource files, with the additional rule that some standard properties could be gotten from applet parameters or system properties. This topic was already discussed in 2001 for Tomcat 3.x on [EMAIL PROTECTED] but coming not to a solution, only a workaround: http://archives.java.sun.com/cgi-bin/wa?A2=ind0107L=jndi-interestF=S =P=2069 Since Tomcat is the reference implementation (of the spec) I would like to have a behavior according to the spec or a clarificaton of it. And I want to specify my basic LDAP connection properties only in one place with inheritance for many webapps and overriding some properties if needed in application specific jndi.properties. Application specific property files cannot do that. Many thanks for thinking about this one. Frerk Meyer EDEKA Aktiengesellschaft GB Datenverarbeitung Frerk Meyer CC Web Technologien New-York-Ring 6 22297 Hamburg Tel: 040/6377 - 3272 Fax: 040/6377 - 41268 mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
web-inf/classes not found ?
Hi ! Tomcat complains that it can't find some of my classes .../web-inf/classes/xxx/yyy/myclassses for example, Everything works fine when I compile it (I specify the -classpath to let the compiler find the classes), but when I run the application in Tomcat, it does not find the classes. The docs says that it should look in the web-inf/classes directory ? Am I doing something wrong here maybe ? Mikael
Re: web-inf/classes not found ?
Ok, thanks, I will see if I can figure out how to do that The documentation says that Tomcat (4) always adds a classloader for each web application that looks in the web-inf/classes and web-inf/dir directory, I could not find any examples/web-inf/classes reference in my server.xml, I guess I should place this information in the context for my application but I have no idea where, but I will see if I can find anything about it in the documentation. Mikael - Original Message - From: Chaber, Eric [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 12:53 PM Subject: RE: web-inf/classes not found ? Mikeal, you have to specify in server.xml where your classes are. for the example directory it's /webapps/examples/web-inf/classes recreate same path in server.xml /webapps/mydir/web-inf/classes reboot tomcat put your class files there tomcat should find them rgds, Eric -Original Message- From: Mikael Aronsson [mailto:[EMAIL PROTECTED]] Sent: September 27 2001 13:55 To: [EMAIL PROTECTED] Subject: web-inf/classes not found ? Hi ! Tomcat complains that it can't find some of my classes .../web-inf/classes/xxx/yyy/myclassses for example, Everything works fine when I compile it (I specify the -classpath to let the compiler find the classes), but when I run the application in Tomcat, it does not find the classes. The docs says that it should look in the web-inf/classes directory ? Am I doing something wrong here maybe ? Mikael
RE: web-inf/classes not found ?
Edit your server.xml copy paste Context path=/examples docBase=webapps/examples crossContext=false debug=0 reloadable=true /Context change examples to mydir create a dir $TOMCAT_HOME/webapps/mydir under my dir creates directories WEB-INF/classes at the end you should have $TOMCAT_HOME/webapps/mydir/WEB-INF/classes reboot tomcat put yur classes there that's how I did for my setup. -Original Message- From: Mikael Aronsson [mailto:[EMAIL PROTECTED]] Sent: September 27 2001 14:24 To: [EMAIL PROTECTED] Subject: Re: web-inf/classes not found ? Ok, thanks, I will see if I can figure out how to do that The documentation says that Tomcat (4) always adds a classloader for each web application that looks in the web-inf/classes and web-inf/dir directory, I could not find any examples/web-inf/classes reference in my server.xml, I guess I should place this information in the context for my application but I have no idea where, but I will see if I can find anything about it in the documentation. Mikael - Original Message - From: Chaber, Eric [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 12:53 PM Subject: RE: web-inf/classes not found ? Mikeal, you have to specify in server.xml where your classes are. for the example directory it's /webapps/examples/web-inf/classes recreate same path in server.xml /webapps/mydir/web-inf/classes reboot tomcat put your class files there tomcat should find them rgds, Eric -Original Message- From: Mikael Aronsson [mailto:[EMAIL PROTECTED]] Sent: September 27 2001 13:55 To: [EMAIL PROTECTED] Subject: web-inf/classes not found ? Hi ! Tomcat complains that it can't find some of my classes .../web-inf/classes/xxx/yyy/myclassses for example, Everything works fine when I compile it (I specify the -classpath to let the compiler find the classes), but when I run the application in Tomcat, it does not find the classes. The docs says that it should look in the web-inf/classes directory ? Am I doing something wrong here maybe ? Mikael
Re: web-inf/classes not found ?
Ok, many thanks for the help. Mikael - Original Message - From: Chaber, Eric [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 1:32 PM Subject: RE: web-inf/classes not found ? Edit your server.xml copy paste Context path=/examples docBase=webapps/examples crossContext=false debug=0 reloadable=true /Context change examples to mydir create a dir $TOMCAT_HOME/webapps/mydir under my dir creates directories WEB-INF/classes at the end you should have $TOMCAT_HOME/webapps/mydir/WEB-INF/classes reboot tomcat put yur classes there that's how I did for my setup. -Original Message- From: Mikael Aronsson [mailto:[EMAIL PROTECTED]] Sent: September 27 2001 14:24 To: [EMAIL PROTECTED] Subject: Re: web-inf/classes not found ? Ok, thanks, I will see if I can figure out how to do that The documentation says that Tomcat (4) always adds a classloader for each web application that looks in the web-inf/classes and web-inf/dir directory, I could not find any examples/web-inf/classes reference in my server.xml, I guess I should place this information in the context for my application but I have no idea where, but I will see if I can find anything about it in the documentation. Mikael - Original Message - From: Chaber, Eric [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 12:53 PM Subject: RE: web-inf/classes not found ? Mikeal, you have to specify in server.xml where your classes are. for the example directory it's /webapps/examples/web-inf/classes recreate same path in server.xml /webapps/mydir/web-inf/classes reboot tomcat put your class files there tomcat should find them rgds, Eric -Original Message- From: Mikael Aronsson [mailto:[EMAIL PROTECTED]] Sent: September 27 2001 13:55 To: [EMAIL PROTECTED] Subject: web-inf/classes not found ? Hi ! Tomcat complains that it can't find some of my classes .../web-inf/classes/xxx/yyy/myclassses for example, Everything works fine when I compile it (I specify the -classpath to let the compiler find the classes), but when I run the application in Tomcat, it does not find the classes. The docs says that it should look in the web-inf/classes directory ? Am I doing something wrong here maybe ? Mikael
Réf. : web-inf/classes not found ?
Hi... you seem working on windows (your email header say so): beware on case ;) it is NOT web-inf, it is WEB-INF (under explorer right-click on dir, porperties gives you exact name). my 2 cents -- Joseph Internet [EMAIL PROTECTED] - 27/09/2001 14:54 Veuillez répondre à [EMAIL PROTECTED] Pour :tomcat-user cc : ccc : Objet : web-inf/classes not found ? Hi ! Tomcat complains that it can't find some of my classes .../web-inf/classes/xxx/yyy/myclassses for example, Everything works fine when I compile it (I specify the -classpath to let the compiler find the classes), but when I run the application in Tomcat, it does not find the classes. The docs says that it should look in the web-inf/classes directory ? Am I doing something wrong here maybe ? Mikael This message and any attachments (the message) is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. - Ce message et toutes les pieces jointes (ci-apres le message) sont etablis a l'intention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le detruire et d'en avertir immediatement l'expediteur. Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'internet ne permettant pas d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce message, dans l'hypothese ou il aurait ete modifie.
Re: Réf. : web-inf/classes not found ?
Hi ! Already done, (I am using Linux 50% of the time so that's the first thing I check) it's all uppercase and it still does not work, but I am pretty sure that I have done something stupid so I will dig around a bit and see if I can fix it. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 1:00 PM Subject: Réf. : web-inf/classes not found ? Hi... you seem working on windows (your email header say so): beware on case ;) it is NOT web-inf, it is WEB-INF (under explorer right-click on dir, porperties gives you exact name). my 2 cents -- Joseph Internet [EMAIL PROTECTED] - 27/09/2001 14:54 Veuillez répondre à [EMAIL PROTECTED] Pour :tomcat-user cc : ccc : Objet : web-inf/classes not found ? Hi ! Tomcat complains that it can't find some of my classes .../web-inf/classes/xxx/yyy/myclassses for example, Everything works fine when I compile it (I specify the -classpath to let the compiler find the classes), but when I run the application in Tomcat, it does not find the classes. The docs says that it should look in the web-inf/classes directory ? Am I doing something wrong here maybe ? Mikael This message and any attachments (the message) is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. - Ce message et toutes les pieces jointes (ci-apres le message) sont etablis a l'intention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le detruire et d'en avertir immediatement l'expediteur. Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'internet ne permettant pas d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce message, dans l'hypothese ou il aurait ete modifie.
Jars in WEB-INF/lib and RMI stubs in WEB-INF/classes not found
How does classloading work in tomcat 3.2.2? In deploying my application I am having problems getting classes loaded aren't on the system classpath. I changed the tomcat.bat so that the generated classpath doesn't doesn't include the system classpath and only includes things built by the batch file. I have placed log4j.jar and crimson.jar into WEB-INF/lib for my app. For other reasons crimson.jar needs to be 1st on the classpath (specifically b4 parser.jar) and I so try adding it by doing like so in batch file: set CP=%TOMCAT_HOME%\webapps\MYAPP\WEB-INF\lib\crimson.jar;%CP% But it isn't found. If I instead do: CP=%TOMCAT_HOME%\lib\crimson.jar it also isn't found. Only if I place it outside of %TOMCAT_HOME% and reference it are classes found. The wierd thing is that I can place log4j.jar in the %TOMCAT_HOME% and have things work (but also can't find classes from it if it's added to classpath referenced from WEB-INF/lib). This also extends to rmi stubs in the WEB-INF/classes directory. Other classes from our app in this dir our found except for the stubs. any ideas, I'm stu[bb|mp]ed...
Re: Jars in WEB-INF/lib and RMI stubs in WEB-INF/classes not found
Sounds like a beaten to death topic. Search TC archives for class loading. --V. PS: sorry for not being too helpful, but this question has been answered way too many times. - Original Message - From: Joshua van Tonder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 2:47 PM Subject: Jars in WEB-INF/lib and RMI stubs in WEB-INF/classes not found How does classloading work in tomcat 3.2.2? In deploying my application I am having problems getting classes loaded aren't on the system classpath. I changed the tomcat.bat so that the generated classpath doesn't doesn't include the system classpath and only includes things built by the batch file. I have placed log4j.jar and crimson.jar into WEB-INF/lib for my app. For other reasons crimson.jar needs to be 1st on the classpath (specifically b4 parser.jar) and I so try adding it by doing like so in batch file: set CP=%TOMCAT_HOME%\webapps\MYAPP\WEB-INF\lib\crimson.jar;%CP% But it isn't found. If I instead do: CP=%TOMCAT_HOME%\lib\crimson.jar it also isn't found. Only if I place it outside of %TOMCAT_HOME% and reference it are classes found. The wierd thing is that I can place log4j.jar in the %TOMCAT_HOME% and have things work (but also can't find classes from it if it's added to classpath referenced from WEB-INF/lib). This also extends to rmi stubs in the WEB-INF/classes directory. Other classes from our app in this dir our found except for the stubs. any ideas, I'm stu[bb|mp]ed...
Re: Jars in WEB-INF/lib and RMI stubs in WEB-INF/classes not found
Sounds like a beaten to death topic. Search TC archives for class loading. --V. PS: sorry for not being too helpful, but this question has been answered way too many times. - Original Message - From: Joshua van Tonder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 2:47 PM Subject: Jars in WEB-INF/lib and RMI stubs in WEB-INF/classes not found How does classloading work in tomcat 3.2.2? In deploying my application I am having problems getting classes loaded aren't on the system classpath. I changed the tomcat.bat so that the generated classpath doesn't doesn't include the system classpath and only includes things built by the batch file. I have placed log4j.jar and crimson.jar into WEB-INF/lib for my app. For other reasons crimson.jar needs to be 1st on the classpath (specifically b4 parser.jar) and I so try adding it by doing like so in batch file: set CP=%TOMCAT_HOME%\webapps\MYAPP\WEB-INF\lib\crimson.jar;%CP% But it isn't found. If I instead do: CP=%TOMCAT_HOME%\lib\crimson.jar it also isn't found. Only if I place it outside of %TOMCAT_HOME% and reference it are classes found. The wierd thing is that I can place log4j.jar in the %TOMCAT_HOME% and have things work (but also can't find classes from it if it's added to classpath referenced from WEB-INF/lib). This also extends to rmi stubs in the WEB-INF/classes directory. Other classes from our app in this dir our found except for the stubs. any ideas, I'm stu[bb|mp]ed...