-
1. Re: multiple versions and multiple use.
kenroberts Dec 20, 2004 8:19 PM (in response to kenroberts)FINALLY, I get to help somebody here!
I just did that yesterday.
Here's what you need:
First thing you need to know is that you need a jboss-app.xml file in your ear's META-INF directory, which will look almost exactly like this, first before version substitution and then after:
<jboss-app>
<loader-repository>repository:loader=/hellobean-@version@.ear</loader-repository>
</jboss-app>
now after substitution where version was set to "1.2.3":
<jboss-app>
<loader-repository>repository:loader=/hellobean-1.2.3.ear</loader-repository>
</jboss-app>
The above limits your class loader to those classes which exist in the ear specified and the ones loaded into the JBoss server, not to those loaded by another EAR. The current default behavior for JBoss is to share classes from one ear to the next, so if you load version 1.2.2 of the class org.my.software.MyClass first, that's the only one that gets loaded anywhere until you undeploy the 1.2.2 version. First come, first served. The above jboss-app.xml will fix that with probably a slightly bigger footprint.
Now, the next thing you need to do is make a separate name for each version as follows in application.xml and everything else too:
<display-name>HelloBean-@version@</display-name>
<web-uri>hellobean-@version@.war</web-uri>
<context-root>/hellobean-@version@</context-root>
hellobean-@version@.jar
Here's a jboss.xml:
<enterprise-beans>
<ejb-name>HelloBean</ejb-name>
<jndi-name>ejb/HelloBean-@version@</jndi-name>
</enterprise-beans>
<resource-managers>
</resource-managers>
I left out the top couple lines on each file, btw, and just gave the main element.
In your build.xml, you convert @version@ to 1.2.3 (for example) as follows:
Hope this helps.