-
1. Re: Cross dependency between ear and war file in Jboss eap 6.0
wdfink May 2, 2014 8:29 AM (in response to sanjmand)I suppose this is the same issue as you can not access classes inside a war which is packaged in an ear file (by spec).
Refer to Class Loading in AS7
-
2. Re: Cross dependency between ear and war file in Jboss eap 6.0
sanjmand May 5, 2014 1:11 AM (in response to wdfink)Hi Wolf,
If we cannot access the classes inside the war, then how will I be able to solve this issue.
Is there any alternate way to fix this issue.
Regards
Sanjeev
-
3. Re: Cross dependency between ear and war file in Jboss eap 6.0
wdfink May 5, 2014 5:58 AM (in response to sanjmand)If you have shared classes you should create a separate jar which can be added as module (AS7) or library (AS6 and former versions).
Another option is to add the classes to both deployments
-
4. Re: Cross dependency between ear and war file in Jboss eap 6.0
sanjmand May 12, 2014 9:41 AM (in response to wdfink)Hi Wolf,
I have created a jar file containing all the classes of "partner.war" file and put it in the "financial.ear", so that same classes are contained in both ear and war file.
however jboss is creating two version of the same class, which is creating a confliction. I am getting following error message in the jboss console.
java.lang.LinkageError: loader constraint violation: when resolving method "com.hp.tiscon.eclaims.financial.webui.bean.partner.starter.recat.UploadShowStatusForm.getTitle()Lcom/hp/tiscon/eclaims/financial/webui/bean/partner/shared/TitleBean;" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, com/hp/tiscon/eclaims/financial/webui/action/partner/starter/PrepareUploadShowStatusAction, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for resolved class, com/hp/tiscon/eclaims/financial/webui/bean/partner/starter/recat/UploadShowStatusForm, have different Class objects for the type com/hp/tiscon/eclaims/financial/webui/bean/partner/shared/TitleBean used in the signature
com.hp.tiscon.eclaims.financial.webui.action.partner.starter.PrepareUploadShowStatusAction.execute(PrepareUploadShowStatusAction.java:86)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
com.hp.tiscon.eclaims.financial.webui.controller.EncodingFilter.doFilter(EncodingFilter.java:151)
How can I come over this issue & get the correct object?
Regards
Sanjeev Kumar
-
5. Re: Cross dependency between ear and war file in Jboss eap 6.0
wdfink May 12, 2014 3:32 PM (in response to sanjmand)Each module and deployment use it's own class loader. If you have a class packed in two different applications/modules and use call-by-reference (i.e. for local interfaces) this will be fail if you have such references in your parameter list.
Refer to Class Loading in AS7
You should pack the classes in a module and depend on it or have the app's in the same ear and add the classes to the lib directory.
Other option is to use remote-interfeces and use call-by-value, but this will have performance issues