Shared loader-repository
bwallis42 Jul 7, 2011 12:17 AMI am trying to port an existing app to AS7 (it is currently running is AS5/6). This is a quite old application that needs a lot of work to update it. This work is gradually being done but for the moment we have to live with a lot of the problems in the code. It was originally an application that embedded a version of tomcat to handle a web interface. A couple of years ago it was turned about and became a few war files deployed into 3 separate tomcat instances. This has again changed to being a few war files deployed into one or two JBoss instances. I think we are progressing :-)
Enough history. We have a feature so that we can develop and deploy new REST or SOAP interfaces outside of our normal release cycle by having these interfaces contained in their own war files. So that these can have access to the internal service APIs in the core product we share the loader repository used by the war by declaring it in the jboss-web.xml deployment descriptor, like so:
{code:xml}
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
au.com.infomedix:archive=InfomedixAppClassLoader
<loader-repository-config>java2ParentDelegation=false
</loader-repository-config>
</loader-repository>
</class-loading>
<context-root>admin</context-root>
</jboss-web>
{code}
Both wars have the same loader repository name.
This is not ideal, bit of a hack really, but works quite well for us.
Is there a way that I could achieve the same thing in JBoss AS7?
thanks
P.S. It would be nice if I could build a war that could be deployed in both AS6 and AS7. The loader-repository element in the jboss-web.xml is not part of the schema anymore in AS7. It would have been nice if it was valid in the schema in AS7 but generated a runtime warning. Now I need two different wars if I am using isolated class loaders in AS6. If the loader-repository was just ignored I think it would just work in AS7 since isolation is the default behaviour.