File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes Mutiple WARs in a Single EAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Mutiple WARs in a Single EAR" Watch "Mutiple WARs in a Single EAR" New topic

Mutiple WARs in a Single EAR

Prakash Lawrence

Joined: Oct 31, 2007
Posts: 1

I just read this message on mutliple wars in a single EAR and i wish you could give me solution for my problem.

Tool Used to deploy EAR : Application Server Toolkit / RAD
Server : WAS

I have an EAR and two Wars war1 and war2 inside the EAR. Each WAR has got their own web.xml. Also there is a seperate context root for both the WARs. Here the problem is after deploying the EAR i can only access the first WAR1 and all the beans are properly loaded when the JSP page i called. In the Second WAR only the JSP page is getting loaded and bean fails to load as it always says method not found. Can you explain me what could be the problem.

In the Application.xml
I have the settings as follows
ClassLoader Mode: Parent_Last
WarClassLoader Policy : Application
Start Weight : 10
ClassLoader Mode: Parent_First
WarClassLoader Policy : this field is disabled
Start Weight : 10000
ClassLoader Mode: Parent_First
WarClassLoader Policy : this field is disabled
Start Weight : 10000

Going to Application

Application->Enterprise Applications->EAR->Class Loader

The General Properties which i have is as follows

Class Loader Order:
Option 1: Classses loaded with parent class loader first
*Option 2: Classes laoded with application class loader first - *this option is chosen**

WAR class loader policy:
Option 1: Class loader for each WAR file in application
Option 2: Single class loader for application - this option is chosen.

In the WAR class loader policy i chose the Option 1 and saw but then it is not working.

Please help me out in this problem....i am in a very urgency situation to find solution for this.

Thanks in advance.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Which class is triggering the method not found exception, which jar file is that class deployed within, and where is that jar file?

If that jar file is in the ear, remove it from the ear and package it in the lib directory of each war file. Then each war file is getting its own version, consistent with the development environment.

Here's a little tutorial I wrote on WebSphere and J2EE classloaders. It talks alot about how to properly package J2EE/JEE5 applications:

Understanding Java Classloaders with WebSphere and J2EE Applications

-Cameron McKenzie
wood burning stoves
subject: Mutiple WARs in a Single EAR
jQuery in Action, 3rd edition