If you want to share them put them in enterprise application project.
.
An enterprise application may contain JAR files that the contained modules will use. This allows sharing of code at the application level, and is the best place to put utility JAR files, or your classes that are used by multiple Web or EJB modules.
WebSphere uses several classloaders to load the application code from the modules deployed to the server. The number and function of these classloaders depends on the classloader isolation mode (otherwise known as module visibility mode) that has been specified in the WebSphere server configuration. There are four settings you can choose:
- Server -- uses the same classloader for the entire server.
- Application -- uses a separate classloader for each Enterprise application.
- Module -- uses a separate classloader for each module.
So I think you need to use classloader isolation mode = Module
Ashraf Galal
(416)804-8359
>From: Sachin Gupta
>Reply-To: An interest list for Sun Java Center J2EE Pattern Catalog >To: J2EEPATTERNS-INTEREST@JAVA.SUN.COM >Subject: J2EE packaging >Date: Thu, 18 Dec 2003 22:50:21 +0530 > >Hi, > >I am not sure if this is the right forum for this question. But if anyone has any inputs on this or let me know where to post this question it will be great. > >I have a EAR which contains two WAR files. I am using WSAD and testing this on the default WAS 5 test environment provided with WSAD. I have a issue while deploying the EAR. > >I have few singleton classes that needs to be shared between the Web modules. By default each web module has it's own instances of these singleton classes. How can I use the same class loaders for both the web modules so that these class are shared across the web modules > >Also How do I package the shar
ed classes so that I need not copy these jars under each Web module's library. > >Thanks, > >Sachin > and get 2 months FREE*
====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@java.sun.com