• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Mutiple WARs in a Single EAR

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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
EAR:
ClassLoader Mode: Parent_Last
WarClassLoader Policy : Application
Start Weight : 10
WAR1:
ClassLoader Mode: Parent_First
WarClassLoader Policy : this field is disabled
Start Weight : 10000
WAR2:
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.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Get me the mayor's office! I need to tell her about this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic