  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | J2EE packaging | J2EE packaging 2003-12-21 - By Katz Guy
Back Hi; I think messing with the classloaders defaults is not a good idea. You will eventually have portability problems cause the hierarchies are different between app servers.. You should think of a more creative idea such as putting this object (singleton) in the JNDI tree and access it from both apps Also, sometimes its not that bad to have two instances of your object (even though it's a singleton), especially if it holds read only data, if this does not compromise your application logically, it will just cause some form of duplication in caching of data.
-- --Original Message-- -- From: joe@(protected) [mailto:joe@(protected)] Sent: Friday, December 19, 2003 10:07 AM To: J2EEPATTERNS-INTEREST@(protected) Subject: Re: J2EE packaging
Sachin,
Your problem can be solved by modifying your EAR settings in WSAD. Like you say, each war module has by default its own classloader and is isolated from the rest of the application. This means that calling ejb modules from the war is ok but calling one war from another is not possible.
To allow calls into the war from another war, you need to change the War classloader policy from MODULE to APPLICATION in the Server (WebSphere Test environment) configuration.
You find this in the server perspective (I assume you use WSAD 5.x), from the Server Configuration view, select the test server you are running on and open it. In the Applications tab at the far right of the configuration you will find the Application Options. Select the EAR you are running and change the War classloader policy.
Hope this solves your problem.
Best regards, J�rn �lmheim SCEA Statoil ASA
==================================================================== 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@(protected) **************************************************************************** *************************** This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses. **************************************************************************** ***************************
==================================================================== 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@(protected)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2655.35"> <TITLE>RE: J2EE packaging</TITLE> </HEAD> <BODY>
<P><FONT SIZE=2>Hi;</FONT> <BR><FONT SIZE=2>I think messing with the classloaders defaults is not a good idea. You will eventually have portability problems cause the hierarchies are different between app servers..</FONT></P>
<P><FONT SIZE=2>You should think of a more creative idea such as putting this object (singleton) in the JNDI tree and access it from both apps</FONT></P>
<P><FONT SIZE=2>Also, sometimes its not that bad to have two instances of your object (even though it's a singleton), especially if it holds read only data, if this does not compromise your application logically, it will just cause some form of duplication in caching of data.</FONT></P>
<P><FONT SIZE=2>-- --Original Message-- --</FONT> <BR><FONT SIZE=2>From: joe@(protected) [<A HREF="mailto:joe@(protected)">mailto :joe@(protected)</A>] </FONT> <BR><FONT SIZE=2>Sent: Friday, December 19, 2003 10:07 AM</FONT> <BR><FONT SIZE=2>To: J2EEPATTERNS-INTEREST@(protected)</FONT> <BR><FONT SIZE=2>Subject: Re: J2EE packaging</FONT> </P> <BR>
<P><FONT SIZE=2>Sachin,</FONT> </P>
<P><FONT SIZE=2>Your problem can be solved by modifying your EAR settings in WSAD. Like you</FONT> <BR><FONT SIZE=2>say, each war module has by default its own classloader and is isolated from</FONT> <BR><FONT SIZE=2>the rest of the application. This means that calling ejb modules from the</FONT> <BR><FONT SIZE=2>war is ok but calling one war from another is not possible.< /FONT> </P>
<P><FONT SIZE=2>To allow calls into the war from another war, you need to change the War</FONT> <BR><FONT SIZE=2>classloader policy from MODULE to APPLICATION in the Server (WebSphere Test</FONT> <BR><FONT SIZE=2>environment) configuration.</FONT> </P>
<P><FONT SIZE=2>You find this in the server perspective (I assume you use WSAD 5.x), from</FONT> <BR><FONT SIZE=2>the Server Configuration view, select the test server you are running on and</FONT> <BR><FONT SIZE=2>open it. In the Applications tab at the far right of the configuration you</FONT> <BR><FONT SIZE=2>will find the Application Options. Select the EAR you are running and change</FONT> <BR><FONT SIZE=2>the War classloader policy.</FONT> </P>
<P><FONT SIZE=2>Hope this solves your problem.</FONT> </P>
<P><FONT SIZE=2>Best regards,</FONT> <BR><FONT SIZE=2>J�rn �lmheim</FONT> <BR><FONT SIZE=2>SCEA</FONT> <BR><FONT SIZE=2>Statoil ASA</FONT> </P>
<P><FONT SIZE=2>=============================================================== =====</FONT> <BR><FONT SIZE=2>Companion Site: <A HREF="http://www.corej2eepatterns.com" TARGET="_blank">http://www.corej2eepatterns.com</A></FONT> <BR><FONT SIZE=2>J2EE BluePrints: <A HREF="http://java.sun.com/blueprints /corej2eepatterns" TARGET="_blank">http://java.sun.com/blueprints /corej2eepatterns</A></FONT> <BR><FONT SIZE=2>List Archive: <A HREF="http://archives.java.sun.com/archives /j2eepatterns-interest.html" TARGET="_blank">http://archives.java.sun.com /archives/j2eepatterns-interest.html</A></FONT> <BR><FONT SIZE=2>Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)</FONT> <BR><FONT SIZE=2>************************************************************** *****************************************</FONT> <BR><FONT SIZE=2>This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals & ; computer viruses.</FONT></P>
<P><FONT SIZE=2>*************************************************************** ****************************************</FONT> </P>
</BODY> </HTML> ==================================================================== 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@(protected)
|
|
 |