Bugs item #625277, was opened at 2002-10-18 15:17 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=625277&group_id=22866
Category: None Group: v3.0 Rabbit Hole Status: Open Resolution: None Priority: 5 Submitted By: Dani G. (danig) Assigned to: Scott M Stark (starksm) Summary: Servlet classloader & static classes Initial Comment: Java version: 1.4.0,Sun Microsystems Inc. Java VM: Java HotSpot(TM) Client VM 1.4.0-b92,Sun OS-System: Windows NT 4.0,x86 JBoss: jboss-3.0.3_tomcat-4.0.5 I have two ear files that are nearly identical. Each contains one jar file and one war file. The jar files contain only stateless session beans. The only differences between the two ear files are the ear file name (DaniTest.ear vs DaniTest2.ear), the web context root (DaniTest vs DaniTest2), and the jndi names to which the stateless session beans in the jar files are bound (ie ejb/DaniTest/BookCtrl vs ejb/DaniTest2/BookCtrl). The web.xml files also differ by having two different values for an environment variable indicating the application name (DaniTest vs DaniTest2). The war files contain a jar file named sfxcommon.jar in WEB-INF/lib. One of the classes in this jar file is JNDIUtil, which is an abstract utility class with static methods used in the servlet and throughout the EJB's to get instances of stateless session beans without having to rewrite the code to get initial contexts, narrow( ), etc. JNDIUtil contains a static private variable to store the base JNDI path to use in retrieving the EJB's, ie "ejb/DaniTest" or "ejb/DaniTest2". This private static variable is initialized the first time it is used based on the app-name environment variable mentioned above. The first time JNDIUtil gets used is always in the servlet. The problem is that when both DaniTest and DaniTest2 are deployed, they *both* use the same JNDIUtil in the servlets, thereby both using the same base path, for example always "ejb/DaniTest". This causes the EJB's in one application to be used by the servlets in both applications. The above example works on WebLogic, so my initial inclination is to believe that it is a bug either in Tomcat itself or in the JBoss code that interacts with Tomcat. ---------------------------------------------------------------------- >Comment By: Dani G. (danig) Date: 2002-12-04 18:38 Message: Logged In: YES user_id=631653 The prognosis above was correct. Once I added a jboss- app.xml file to the ear's META-INF directory with a <loader- repository> element, the problem was solved. The only online information available on this file is in the forums at jboss.org; it might be a good idea to add a DTD and other documentation to the web site. I'm leaving the bug open, as the solution, in my mind, is the addition of the documentation. If this is not the case, feel free to close it. Thanks! ---------------------------------------------------------------------- Comment By: Scott M Stark (starksm) Date: 2002-10-29 00:28 Message: Logged In: YES user_id=175228 EJBs cannot see into a war WEB-INF/lib so are you sure that JNDIUtil is not in a jar referenced by the ejb jars? The behavior you describe indicates that this is the case, and is expected given the 3.0 flat classes namespace. To isolate the ears from each other you need to use scoped class loading on the ear as described in the the 3.0 change note numbered 558189. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=625277&group_id=22866 ------------------------------------------------------- This SF.net email is sponsored by: Microsoft Visual Studio.NET comprehensive development tool, built to increase your productivity. Try a free online hosted session at: http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development