Classloader issues with ejbdeploy - Websphere

This is a discussion on Classloader issues with ejbdeploy - Websphere ; Our application uses JDOM 1.0 Final and WebSphere apparently doesn't. Is there a way to get WebSphere to use our jars when running ejbdeploy? I've tried to specify the -cp option to ejbdeploy, but that still doesn't work. Here is ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Classloader issues with ejbdeploy

  1. Classloader issues with ejbdeploy

    Our application uses JDOM 1.0 Final and WebSphere apparently doesn't. Is there a way to get WebSphere to use our jars when running ejbdeploy? I've tried to specify the -cp option to ejbdeploy, but that still doesn't work.

    Here is the output from ejbdeploy with -rmic -verbose. You'll notice that there is a mismatch of where the JDOM classes are coming from:

    [loaded /opt/WebSphere/AppServer/lib/jdom.jar(org/jdom/Namespace.class) in 1 ms]
    [loaded /opt/WebSphere/AppServer/lib/jdom.jar(org/jdom/Attribute.class) in 15 ms]
    [loaded /opt/WebSphere/AppServer/lib/jdom.jar(org/jdom/DataConversionException.class) in 0 ms]
    [loaded /opt/WebSphere/AppServer/lib/jdom.jar(org/jdom/JDOMException.class) in 0 ms]
    [loaded /opt/WebSphere/AppServer/lib/jdom.jar(org/jdom/Document.class) in 1 ms]
    [loaded /opt/WebSphere/AppServer/lib/jdom.jar(org/jdom/DocType.class) in 0 ms]
    [loaded /opt/WebSphere/AppServer/lib/jdom.jar(org/jdom/Comment.class) in 10 ms]
    [loaded /opt/WebSphere/AppServer/lib/jdom.jar(org/jdom/ProcessingInstruction.class) in 1 ms]
    [loaded /opt/WebSphere/AppServer/lib/jdom.jar(org/jdom/CDATA.class) in 1 ms]
    [loaded /opt/WebSphere/AppServer/lib/jdom.jar(org/jdom/EntityRef.class) in 1 ms]
    ...
    [loaded /tmp/ear/jdom.jar(org/jdom/Content.class) in 1 ms]
    [loaded /tmp/ear/jdom.jar(org/jdom/Parent.class) in 0 ms]
    [loaded /tmp/ear/jdom.jar(org/jdom/filter/Filter.class) in 0 ms]


  2. Re: Classloader issues with ejbdeploy

    Hi,

    The ejbdeploy tool is used to create the necessary generated code, including the stub and ties, for EJBs to work within WebSphere.

    Why would you want to override the creation of the necessary code? You can override the jar within the container by specifying PARENT LAST.

    Brian

  3. Re: Classloader issues with ejbdeploy

    I probably didn't describe my problem well enough. We are using PARENT_LAST in the container to avoid picking up the WebSphere's jars first, but there seems to be no way to do the same thing when generating the deployment code.

    When the ejbdeploy picks up classes from different versions of jdom.jar we see this error (com.logiclibrary.common.metadata.Element is subclassing org.jdom.Element):

    !MESSAGE java.lang.VerifyError: (class: com/logiclibrary/common/metadata/Element, method: removeChildAt signature: (I)V) Incompatible argument to method
    at java.lang.ClassLoader.resolveClass0(Native Method)
    at java.lang.ClassLoader.resolveClass(ClassLoader.jav a:971)
    at com.ibm.tools.rmic.iiop.DirectoryLoader.loadClass( DirectoryLoader.java:128)
    at com.ibm.tools.rmic.iiop.CompoundType.loadClass(Com poundType.java:351)
    at com.ibm.tools.rmic.iiop.Type.initClass(Type.java:1 007)
    at com.ibm.tools.rmic.iiop.Type.setRepositoryID(Type. java:1024)
    at com.ibm.tools.rmic.iiop.CompoundType.initialize(Co mpoundType.java:759)
    ...

  4. Re: Classloader issues with ejbdeploy

    Hi,

    You can modify the /deploytool/itp/ejbdeploy.sh script.


    modify the
    -Dws.ext.dirs=":$WAS_EXT_DIRS" (unix)
    -Dws.ext.dirs=";%WAS_EXT_DIRS%" (windows)

    This is not supported by IBM, but it will help you modify you run the ejbdeploy tool. I am not sure if the newer version will break anything, but it is worth a try.

    Brian


+ Reply to Thread