I have a WAR that is configured to use a cloud class loader under JBoss. All this works great and dandy. The configuration for it in jboss-web.xml looks something like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 4.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd"> <jboss-web> <class-loading> <loader-repository> com.mycompany:loader='com.mycompany.repository' <loader-repository-config>java2ParentDelegation=false</loader-repository-config> </loader-repository> </class-loading> </jboss-web>
Now the client wants to deploy two copies of our WAR file under the same JBoss instance. They are configured to use the same classloader repository, which causes problems.
If I manually modify jboss-web.xml inside one copy of the WAR file to indicate a different repository, for example, changing the corresponding line to:
com.mycompany:loader='com.mycompany.repository2'
... both copies of the WAR deployment no problem.
However, hacking internal WAR files is not a fantastic solution for the client.
If I could include, say, the context root in the repository name (or some other property that is guaranteed to be different between the two deployments), this can be done automatically.
Is it possible to use properties in jboss-web.xml ?, allowing me to do something like:
com.mycompany:loader='com.mycompany.repository-${jboss.context-root}'
(Note: I created this property name.)
Step back a bit, is there a better way to accomplish what I'm trying to accomplish?
Aron
source share