0

My situation is the following: I want to deploy a special MXBean using a SAR archive. This should be easy, right?

Right, unless the bean references classes from an external library. When this happens, I found no way of telling JBoss to add to the classpath those external libraries that I'm packaging along with my bean in the SAR archive.

Until now I have tried the following:
1. Simply add the libraries in the root of the archive.
2. Modify the Class-Path manifest entry to add the library name there
3. Added a jboss-structure.xml (copied from one of jboss5's sar archives from the /deploy dir)
4. Looked into jboss-deployment-structure.xml but really found no connection to what I am trying to do.

Whatever I tried I just couldn't convince JBoss to load the classes I'm referencing in my bean from the libraries packaged as jars inside the sar archive.

Any clues?

andrei.serea
  • 950
  • 1
  • 9
  • 15

1 Answers1

0

In the meantime I managed to figure it out, thanks to the following article http://middlewaremagic.com/jboss/?p=1081

The catch is simple: Just add the jboss-deployment-structure.xml file to the META-INF directory, with the following content:

<jboss-deployment-structure>
<deployment>
    <resources>
        <resource-root path="_path_to_archive_goes_here_" />
    </resources>
</deployment>

That's it. Jboss will add the resource specified to the classpath of the deployed SAR archive. Hope this helps somebody.

andrei.serea
  • 950
  • 1
  • 9
  • 15