facebook

Classloader issue – Need two different versions of a Jar

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #274565 Reply

    GGJ
    Participant

    I’m updating my web application to use a newer version of a third party jar. The third party jar needs a modified version of axis.jar which they have supplied. If I run a simple java main program to test the code everything works fine.

    When I run the same code from my web application I get a NoClassDefFoundError.

    java.lang.NoClassDefFoundError: org/apache/axis/transport/http/HTTPSender

    I have verified that the modified version of axis.jar has the class HTTPSender and is in my /lib directory. I assume JBoss has picked up the axis.jar version that comes with JBoss. How can I tell the classloader to load the modified version of axis.jar in my /lib directory?

    Using: JBoss 3.2.3

    Any workarounds? Thanks, Glenn

    #274617 Reply

    Riyad Kalla
    Member

    Glenn,
    When you say your /lib dir, you mean the one under WebRoot/WEB-INF/lib right? Also are you going out to the deployed application’s location and making sure that the axis JAR is in the deployed folder and getting there correctly?

    #274624 Reply

    GGJ
    Participant

    @support-rkalla wrote:

    Glenn,
    When you say your /lib dir, you mean the one under WebRoot/WEB-INF/lib right? Also are you going out to the deployed application’s location and making sure that the axis JAR is in the deployed folder and getting there correctly?

    Yes “/WebRoot/WEB-INF/lib” directory. Yes I verified its location in the deployed folder too.

    From what I’ve read on the net sounds like the JBoss default classloader is to load each reference once. So if JBoss startup references Axis.jar first, then that is the version that is loaded and my web app Axis.jar version is not.

    What’s the best way to override this behavior?

    Thanks, Glenn

    #274629 Reply

    Riyad Kalla
    Member

    Glenn there is a way to work around this by specifying each web project use it’s own class loader… docs here:
    http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossClassLoadingUseCases

    try scrolling to the bottom. I think you need a jboss-web.xml file with some config in it specifying that, like useJBossClassLoader=true, but I don’t know the format of the file.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Classloader issue – Need two different versions of a Jar

You must be logged in to post in the forum log in