-
1. Re: JBOSS AS7 Wildfly 8.x classloader issue
jaysensharma Nov 24, 2015 7:38 AM (in response to vivekgade123)Please explain the following:
1). From which code/application are you trying to access the classes present in JAR "myexample.ear/abc.jar"
2). Please post the code which you are using to access the classes present inside the "myexample.ear/abc.jar"
Assuming that you have some other client application deployed on the same WildFly instance and that application wants to access the classes present inside "myexample.ear/abc.jar"
If you really want to load a class which is present inside a separate EAR/JAR from another code deployed on the same server you can try using the "jboss-deployment-structure.xml" file as following:
For EAR put it inside the "ClientApp.ear/META-INF/jboss-deployment-structure.xml" (If you have WAR as a client then try "ClientWebApp.war/WEB-INF/jboss-deployment-structure.xml")
<?xml version="1.0"?> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <deployment> <dependencies> <module name="deployment.myexample.ear.abc.jar" export="true" /> </dependencies> </deployment> </jboss-deployment-structure>
Then the classes present inside your Client App (ClientApp.ear or ClientWebApp.war) can access the classes present inside the "deployment.myexample.ear.abc.jar"
Same thing can also be achieved using the "META-INF/MANIFEST.MF" following entry:
Dependencies: deployment.myexample.ear.abc.jar
https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly
Regards
Jay SenSharma