Classloader Problem with Ext Lib - Websphere

This is a discussion on Classloader Problem with Ext Lib - Websphere ; Hi, I'm using IBM WebSphere Application Server, 6.0.2.15 on Windows and IBM WebSphere Application Server, 6.0.2.17 on Linux. I have a web application (let's say with jar1, jar2 and jar3) and a Customer User Registry Implementation (let's say with jar2 ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Classloader Problem with Ext Lib

  1. Classloader Problem with Ext Lib

    Hi,
    I'm using IBM WebSphere Application Server, 6.0.2.15 on Windows and IBM WebSphere Application Server, 6.0.2.17 on Linux.

    I have a web application (let's say with jar1, jar2 and jar3) and a Customer User Registry Implementation (let's say with jar2 and jar3 and jar4) and a second web application (let's say with jar1, jar2 and jar5)

    Deployment User Registry:
    jar2,jar3 and jar4 are under /lib/ext
    Deplyoment Web Application
    jar1 is in WEB-INF/lib.
    Deployment Web App 2:
    jar1, jar5 is in WEB-INF/lib

    When I start my application I get a java.lang.ClassNotFoundException for App1 but App2 runs with no problems.

    So I changed my deployment to

    Deployment User Registry:
    jar2,jar3 and jar4 are under /lib/ext

    Deplyoment Web Application
    jar1,jar2,jar3 is in WEB-INF/lib.

    Deployment Web App 2
    jar1, jar2 and jar5 in WEB-INF/lib.

    I still get a java.lang.ClassNotFoundException but for a different class for App 1 but App2 runs fine.

    I thougt, everything loaded by the ext-Classloader is visible / useable for the Application Classloader?

    Did I understand something totally wrong? Is there a workaround

    Thanks,
    Volker

  2. Re: Classloader Problem with Ext Lib

    volker.konrad@t-systems.de wrote:
    > Hi,
    > I'm using IBM WebSphere Application Server, 6.0.2.15 on Windows and IBM WebSphere Application Server, 6.0.2.17 on Linux.
    >
    > I have a web application (let's say with jar1, jar2 and jar3) and a Customer User Registry Implementation (let's say with jar2 and jar3 and jar4) and a second web application (let's say with jar1, jar2 and jar5)
    >
    > Deployment User Registry:
    > jar2,jar3 and jar4 are under /lib/ext
    > Deplyoment Web Application
    > jar1 is in WEB-INF/lib.
    > Deployment Web App 2:
    > jar1, jar5 is in WEB-INF/lib
    >
    > When I start my application I get a java.lang.ClassNotFoundException for App1 but App2 runs with no problems.
    >
    > So I changed my deployment to
    >
    > Deployment User Registry:
    > jar2,jar3 and jar4 are under /lib/ext
    >
    > Deplyoment Web Application
    > jar1,jar2,jar3 is in WEB-INF/lib.
    >
    > Deployment Web App 2
    > jar1, jar2 and jar5 in WEB-INF/lib.
    >
    > I still get a java.lang.ClassNotFoundException but for a different class for App 1 but App2 runs fine.
    >
    > I thougt, everything loaded by the ext-Classloader is visible / useable for the Application Classloader?
    >
    > Did I understand something totally wrong? Is there a workaround
    >
    > Thanks,
    > Volker
    >

    Everything in /lib/ext is visible to all applications. You're overriding
    this in your first web application. Depending on whether you have
    PARENT_FIRST or PARENT_LAST, one or the other will be loaded.

    What you cannot do is have a class loaded in /lib/ext depend on a class
    in your WAR.

    Ken

  3. Re: Classloader Problem with Ext Lib

    In your first deployment, you have jar2,3,4 in the lib/ext. Do any of those jars need Jar1?

    Jar1 can reference classes in jar2,3,4, but not the other way around.

  4. Re: Classloader Problem with Ext Lib

    Hi Roy,
    thank you very much. That was the problem.
    Some tricky reflection thing:
    A class from ext-lib-Loader tried to access one of it's subclasses from application class loader...
    and that did not work.

+ Reply to Thread