users@glassfish.java.net

Isolate properties files between two WARs in an EAR

From: <glassfish_at_javadesktop.org>
Date: Fri, 22 Aug 2008 14:06:58 PDT

Hi!

I am using glassfish v2 and have an EAR application with two WARs inside. I put all the jars common to both in the EAR root level and only the specific jars inside each WAR WEB-INF/lib.

I have a library (displaytag.jar) in the two WARs and the configuration of displaytag is made by a properties file. Because each of the WARs have different configurations, I put a displaytag.properties file in each WEB-INF/classes and a displaytag.jar in each WEB-INF/lib.

The problem is that when one application loads the displaytag.properties, the other uses the same properties, ignoring its own properties file. Is there a way to solve this problem without using the class-loader delegate="false" configuration in sun-web.xml?

If I use class-loader delegate="false" my application begin to have problems with ClassCastExceptions. In this case, should I put all the jars, its dependencies and resources (xml, properties files) in the same classloader?

Thanks!
[Message sent by forum member 'renato_rka' (renato_rka)]

http://forums.java.net/jive/thread.jspa?messageID=294915