Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Glassfish 3 - 2 wars - log4j on class path twice

 
Ally Cavs
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys

If I deploy either War on its own in GF3 and the app works fine.

When I deploy the second I get an exception on deployment to say Log4jException is on the class path twice
The 2 wars package their jars in the lib folder at root level. I thought each app has its own class path and should not conflict. But this is not the case.
I listed all jars in lib folder in the manifest file. this did not solve the problem. In only did this for 1 war though.and i used maven to do this. maven listed the jar names not lib/jar_Name.jar which is what I was expecting to see

I have a number of applications i need to deploy so its a big job to start pulling out common jars and puting them in the domain's lib folder.
Any advice on how to force GF3 to make sure to use the library bundled in the particular war in question?

Thanks
Alan
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it would make more sense to put your Log4J JAR in the server's common library, and refer to that library from your WAR code instead of bundling it in with each app.

If you must bundle Log4J with each app, you could just deploy the WARs to different domains.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic