aspose file tools*
The moose likes JBoss/WildFly and the fly likes War depending on War -classpath issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "War depending on War -classpath issues" Watch "War depending on War -classpath issues" New topic
Author

War depending on War -classpath issues

A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 978
Hi,

I have a ear where in war A depends on war B for few classes.....and i use Eclipse ide for setting up the ear..
when i deploy it ..the war B loads properly but ,,War A gives error,,and the exception is classnot found...its not able to find the classes referenced from war b.

Any idea to resolve this..

Regards
Kees Jan Koster
JavaMonitor Support
Rancher

Joined: Mar 31, 2009
Posts: 251
    
    5
Dear Kumar,

WAR files must be self contained and cannot depend on each other. So your design is flawed. Just because it works in Eclipse does not make it up to spec. Change the structure of your code to put the common classes in a JAR in WEB-INF/lib for each WAR.

Kees Jan


Java-monitor, JVM monitoring made easy <- right here on Java Ranch
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 978
But it runs in Websphere app server 6.1. what i want to know is how to make it ...run on jboss 4.2.x
Kees Jan Koster
JavaMonitor Support
Rancher

Joined: Mar 31, 2009
Posts: 251
    
    5
In that case WebSphere is not adhering to the JEE spec. So your design was flawed and WebSphere failed to point that out to you.

Put the shared classes in a JAR in WEB-INF/lib in each WAR. File a bug report for WebSphere.

Kees Jan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: War depending on War -classpath issues
 
Similar Threads
Maven question: test-ear or test-war
strange things happen - Non matching type for @Inject of setter:
Is a standalone war file treated as part of a "master" web-app?
Urgent: cannot find property file in war when packaged in ear
Maven - Compile dependency on Jar(s) inside EAR