Topic
6 replies Latest Post - ‏2014-01-06T15:33:05Z by bpaskin
Wortas
Wortas
45 Posts
ACCEPTED ANSWER

Pinned topic Classloading again WAS 8.5

‏2014-01-06T08:38:22Z |

Hi, 

I found strange problem during porting from jBoss. Sometimes when we are starting the application we end up in white blank screen in admin console. Checking the logs I see  this error:

[1/6/14 9:10:28:548 CET] 0000007e ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0014E: Uncaught service() exception root cause action: com.ibm.websphere.servlet.error.ServletErrorReport: java.lang.NoClassDefFoundError: org.apache.commons.lang.StringUtils

My application is ear with on war in it, both(ear+war) contains in MANIFEST-MF file classpath entries commons-lang.jar. The ear file hold this referenced jar in its /lib folder. So I don't know why WAS has problem particullary with this library. I red some article where it is said, that WAS runtime libs already are using commons-lang library, but that should imply some version clash not a ClassDefFoundError, right?

Anybody ideas? Any help highly appreciated.

Regards

 

M.W. 

 

  • bpaskin
    bpaskin
    3837 Posts
    ACCEPTED ANSWER

    Re: Classloading again WAS 8.5

    ‏2014-01-06T09:15:50Z  in response to Wortas

    Hi, I would turn on verbose classloading and see if that jar is being loaded elsewhere.  Also, could you post your MANIFEST.MF file?

    I am attaching an ear file that works on my system.

    Regards,

    Brian

    Attachments

    Updated on 2014-01-06T09:43:34Z at 2014-01-06T09:43:34Z by bpaskin
    • Wortas
      Wortas
      45 Posts
      ACCEPTED ANSWER

      Re: Classloading again WAS 8.5

      ‏2014-01-06T12:23:54Z  in response to bpaskin

      This is what I see in the log

      22283: class load: org.apache.soap.util.StringUtils from: file:/C:/tools/IBM/websphere/plugins/com.ibm.ws.prereq.soap.jar

      30549: class load: com.ibm.jtc.jax.xml.ws.util.StringUtils from: file:/C:/tools/IBM/websphere/plugins/com.ibm.jaxws.tools.jar

      seems it is not loading the jar from the ear lib folder at all, nonetheless I'm no wiser from the output. Seems other libraries are loaded without problem i.e.:

      class load: org.bouncycastle.asn1.pkcs.PKCS12PBEParams from: file:/C:/tools/IBM/websphere/profiles/AppSrv01/installedApps/PRGLAPB2RDGV1Node01Cell/ksa-cms-ear.ear/lib/bcprov-jdk15on-1.49.jar

      I tried to set parent-last and one classloader per application, but without success:(

       

       

      Attachments

      • bpaskin
        bpaskin
        3837 Posts
        ACCEPTED ANSWER

        Re: Classloading again WAS 8.5

        ‏2014-01-06T12:47:23Z  in response to Wortas

        Hi, it appears that your application is not finding the org.apache.commons.lang.StringUtils.  Can you make sure that the commons-lang jar is actually in the .ear/lib directory?

        I moved backwards to commons-lang 2.6 and my app and it is working without modifying the classloader.

        Regards,
        Brian

         

        Attachments

        • Wortas
          Wortas
          45 Posts
          ACCEPTED ANSWER

          Re: Classloading again WAS 8.5

          ‏2014-01-06T14:53:23Z  in response to bpaskin

          Yes of course I double checked that, what if I'm using shared library and the class is requested from one of jars placed there? Is there any default shared library where can I put commons and non-app jars? There is something like ext folder, isn't it? 

          Can you explain to me how such a situation can arise at all? What is happening in the classloaders? The output from classloading debug info is not very helpful. I will maybe try to debug the application and investigate the classloader, if it is possible. 

          Your ear is working seamlessly. Will try out to figure from which module the library is called.

           

          M.

          • bpaskin
            bpaskin
            3837 Posts
            ACCEPTED ANSWER

            Re: Classloading again WAS 8.5

            ‏2014-01-06T15:29:47Z  in response to Wortas

            Hi, There is no reason why it would not work with the classloader.  We can turn on to see which files it is looking for in the classpath, if needed. However, I suspect the problem is something else all together.   It should find the jar file and it does not matter if it is referenced from a shared lib.  You can place classes in the <WAS_HOME>/lib/ext or, better yet, add ws.ext.dirs  to the custom properties of the jvm.  Can you absolutely make sure that what Maven has put together has placed the jar in the lib folder of the .ear and the MANIFEST for the war is correct in the exploded ear? 

            Regards,

            Brian

            • bpaskin
              bpaskin
              3837 Posts
              ACCEPTED ANSWER

              Re: Classloading again WAS 8.5

              ‏2014-01-06T15:33:05Z  in response to bpaskin

              For tracing you can add the following to the jvm custom properties: ws.ext.debug = true and add the following diagnostic trace spec: com.ibm.ws.classloader.*= all

              Regards,

              Brian