1 Reply Latest reply on Apr 11, 2013 10:54 AM by andrei.serea

    Reference external libraries from a SAR archive in JBoss AS 7

    andrei.serea

      Hello everyone!

       

      Here is my problem: 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, you want to pack the libraries in the SAR archive and add them to the classpath. Unfortunately I found no way of telling JBoss to add to the classpath these libraries.

      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?