• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAR files conflict issue

 
Ranch Hand
Posts: 47
Eclipse IDE Tomcat Server Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
rastogi payam
Ranch Hand
Posts: 47
Eclipse IDE Tomcat Server Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 47
Eclipse IDE Tomcat Server Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you also done the same thing in B.war?
 
rastogi payam
Ranch Hand
Posts: 47
Eclipse IDE Tomcat Server Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic