Raghu
Raghu

Reputation: 11

JBOSS7 external jar with dependency on ear file

I am using JBOSS 7

In my custom jar I am implementing an Interface. The interface is in a jar packaged with ECM.ear file. Unless I put my custom jar inside the web-inf/lib folder (of the war file located in ear file) I am getting ClassNotFoundException w.r.to the interface.

I created a module for my custom jar but I don't how to set up a dependency with ear file. I copied the jar containing the interface say mdm.jar and placed it in the module and also added an entry in the resource root of module.xml. After restarting I am getting ClassNotFoundException for the classes referred by mdm.jar, which arein ear file.

How to achieve this dependency?

Thanks, Raghu

Upvotes: 1

Views: 1055

Answers (1)

amitsalyan
amitsalyan

Reputation: 678

JBOSS 7 needs you to place the packaged jar files in the lib folders of your web-inf/lib or the ear/lib cos of the Class Loading Precedence that JBOSS server follows.

Alternatively you could load it as a module, but you need to specify any addition of this kind outside of JBOSS default supplied modules using your MANIFEST file or jboss-deployment-structure.xml

This link should provide you more insight on what would suit you best. Hope it helps.

Upvotes: 1

Related Questions