aspose file tools*
The moose likes JBoss/WildFly and the fly likes JAR files conflict issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JAR files conflict issue" Watch "JAR files conflict issue" New topic
Author

JAR files conflict issue

rastogi payam
Ranch Hand

Joined: May 09, 2011
Posts: 45

Hi All,

We have deployed two applications on the same server on JBOSS. The first application (say 'A' ) is using itext2.17.jar (newer version) and The second application (say 'B') is using itext1.3.jar (older version -also deprecated).When the server starts up it loads the jar file from application 'A' due to which the application 'B' is not able to perform some functions
If we put itext1.3.jar in endorsed folder of JBOSS, application 'A' is failing to perform some functions.
Can anybody suggest some way around to get these both applications work with their own libraries set.

Thanks


SCJP 1.6, OCPWCD 5
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Which version of JBoss AS?

I assume that the JAR file is packaged with the app. Then you should set up a classloader repository for each app - that will isolate the classloaders for the two apps, letting each one use its own copy of the JAR.
https://community.jboss.org/wiki/ClassLoadingConfiguration


JBoss In Action
rastogi payam
Ranch Hand

Joined: May 09, 2011
Posts: 45

We are using JBoss 5.1.0 GA
We are getting the following exception when we tried to hit our application
------------------------Exception-------------------------------
Cause of Invocation Error org/apache/axiom/om/OMNode
[2012-01-30 11:51:15,272] DEBUG - [] [http-172.21.161.94-8080-1] - java.lang.NoClassDefFoundError
[2012-01-30 11:51:15,272] DEBUG - [] [http-172.21.161.94-8080-1] - It is a java type exception
[2012-01-30 11:51:15,272] DEBUG - [] [http-172.21.161.94-8080-1] - org/apache/axiom/om/OMNode
[2012-01-30 11:51:15,272] DEBUG - [] [http-172.21.161.94-8080-1] - Error string after errrors. is rg/apache/axiom/om/OMNode
------------------------------------------------------------------
however, the jar containg this class is present in both A.war and B.war
so I have created jboss-web.xml with the following entry and kept it in A.war/WEB-INF folder

------------------jboss-web.xml-------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>A</context-root>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
org.apache.axiom.om.OMNode:loader=A.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>
----------------------------------------------------------------
Still we are getting the same exception
Please suggest.
rastogi payam
Ranch Hand

Joined: May 09, 2011
Posts: 45

One more xml file is also present in A.war/WEB-INF folder with name jboss-classloading

--------------------------------jboss-classloading.xml-----------------
<classloading xmlns="urn:jboss:classloading:1.0"
name="A.war"
domain="172.168.2.94"
export-all="NON_EMPTY"
import-all="true"
parent-first="true">
</classloading>
---------------------------------------------------------------------------
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Have you also done the same thing in B.war?
rastogi payam
Ranch Hand

Joined: May 09, 2011
Posts: 45

Hi All,

iText.jar issue was resolved by placing the itext1.3jar in <jboss>/server/default/lib and the other issue was resolved by removing all the other jars from there(default/lib).

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAR files conflict issue