• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class conflict in jar and war

 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we prepare a war ,We have some classes which are go into the war as well as the jar(to be kept in ejb tier)When thsi EAR is deployed on Weblogic7.0 and the class is accessed then at runtime this gives 500 internal server error. Can anybody pl tell why?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should take a look at WebLogic's log files. The HTTP 500 error you're seeing in your browser would indicate that someone threw an exception and it's probably logged somewhere...
 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually all this problem is because we do not know how to package third party jars along with the ear . It is simple if the war uses them ,we can simply place them ine WEB-INF/lib , but what when they are needed by the ejb tier classes.
PL help
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, you need to add the "utility" .jar file into the .ear file next to your .wars and .jars and then add a "Class-Path:" manifest entry into each "mywebapp.war" and "myejb.jar" that needs to use the utility classes.
Take a look at this article (search for "better solution"...)
 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we have tried that but still the problem remains. do we need to make any entries in the application.xml
the structure is as follow
App.ear :
a.war
b.jar
util1.jar
util2.jar
in b.jar's manifest.mf we have entires Class-Path: util1.jar util2.jar
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lasse is correct. Hopefully this article from TheServerSide helps:
Understanding J2EE Application Server Class Loading Architectures
 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if a class(cacheloader) is present in both the war and ejb-jar but is used only by the web classes will the server give any error
With the fact that this class uses a third party jar which IS present in WEB-INF/lib but not in ejb-jar dependent's
Pls note that this class is never instantiated in the ejb container hence would never require the third party jar.
I am using weblogic7
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class-path entry should be in the manifest files of war and ear files rather than b.jar.

Originally posted by Monmohan Singh:
we have tried that but still the problem remains. do we need to make any entries in the application.xml
the structure is as follow
App.ear :
a.war
b.jar
util1.jar
util2.jar
in b.jar's manifest.mf we have entires Class-Path: util1.jar util2.jar
 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay, will we need in war also ( since we are keeping the jars in WEB-INF/lib)
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay, will we need in war also ( since we are keeping the jars in WEB-INF/lib)

It is better to put the common jar files outside of ear and war.
 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just now I have tried it.Now it is not able to load the properties files in web ( they are placed at WEB-INF/classes)
do we need to place them as well in the ear and put the .properties in the classpath entry in manifest.mf??
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic