0

How do I reference a library deployment that is not in the modules folder from an ear deployment in jboss 7? I have a common library (jar) deployed ok, and an ear deployment fails because it can't not locate the classes deployed in the common jar from earlier

2 Answers2

0

It should go into the lib/ folder in the EAR and <library-directory/> needs to be set in META-INF/applicaiton.xml.

Philippe Marschall
  • 4,452
  • 1
  • 34
  • 52
  • this is not an option because it would mean redeploying every application everytime you change common lib code that should not require an app change. if you have 20+ ears that reference it building them all is a waste of time for a code change in an external library – Nicholas Fitzroy Mar 13 '13 at 14:08
  • Well, you'll need to run all your tests of all the EARs against the new library anyway. And building all the EARs just takes pressing a button. – Philippe Marschall Mar 15 '13 at 08:40
0

If you deployed the common JAR you need to add a dependency in the MANIFEST.MF of your EAR or create a jboss-deployment-structure.xml. The class loading documentation has more details.

The module name of the deployment should be something like deployment.name_of_deployment.jar.

James R. Perkins
  • 16,800
  • 44
  • 60
  • I tried using deployment. as the module name with every arrangement of tags in jboss-deployment-structure.xml defined at "https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7". However, none of them were able to read the jar file and ear deployment instantly fails every time due to class not found exception – Nicholas Fitzroy Mar 13 '13 at 14:07
  • Where did you put the `jboss-deployment-structure.xml`? I assume too that the jar is deployed before you deploy the EAR, corrct? – James R. Perkins Mar 14 '13 at 15:58
  • the library was deployed first, the file is in .ear/META-INF/jboss-deployment-structure.xml – Nicholas Fitzroy Mar 14 '13 at 20:45
  • What does the error message say? Just a ClassNotFoudException? – James R. Perkins Mar 14 '13 at 23:42