Topic
  • 5 replies
  • Latest Post - ‏2015-01-17T08:11:04Z by gduser
SystemAdmin
SystemAdmin
14225 Posts

Pinned topic Class loader issues in RAD / WAS 8.5.1

‏2013-03-25T16:02:22Z |
I'm having difficulties with RAD / WAS 8.5.1 not loading the class that I expect it to. My application is being developed against Spring 3.2.1, and I would like to use the automatic Jackson JSON parsing to convert my Ajax posts directly to their corresponding Java objects. I'm running into a NoSuchMethodError when I post. The exception is occurring in MappingJacksonHttpMessageConverter in getJavaType when it calls TypeFactory.type. When I attempt to step into that class to see what's going on, RAD tells me that it's looking for the source code in com.ibm.ws.prereq.jackson.jar. Looking at that JAR I can see that it is many years old (2010), and out of sync with the version of Jackson (1.9.7) that I am using otherwise.

So, my question is why is WAS using this older version of Jackson and how do I get it to use the version I have bundled in my EAR? I've tried changing the class loader policy to parent last, which yielded the same result.

Thanks!
Updated on 2013-04-02T19:52:14Z at 2013-04-02T19:52:14Z by ivyho
  • SystemAdmin
    SystemAdmin
    14225 Posts

    Re: Class loader issues in RAD / WAS 8.5.1

    ‏2013-03-28T15:42:48Z  
    Any ideas? Anyone?
  • ivyho
    ivyho
    67 Posts

    Re: Class loader issues in RAD / WAS 8.5.1

    ‏2013-04-02T19:52:14Z  
    Any ideas? Anyone?
    Hi How are you publishing your application?
    Are you using the "Add and Remove" inside the RAD workbench to publish your EAR to the local test environment?

    First try this:
    As you mentioned, if you already change the class loading policy in WAS 851.
    Try export the EAR outside of RAD , install the application via the WAS 851 admin console.
    Try testing your application and see if the correct jar being loaded.
    If it still loads the old jars, then open PMR to websphere support team to check out the class loading issue.

    If this works, then try inside RAD.
    If you are publishing the EAR via "Add and Remove" inside the RAD workbench.
    double click on the server instance inside RAD to get to the server configurations.
    Try to disable - minimize applications files copied to the server
    Use Run server with resources on Server.
    Save the settings,
    restart WAS and republish and see if this make any differences.

    Hope this helps
  • rubensa
    rubensa
    1 Post

    Re: Class loader issues in RAD / WAS 8.5.1

    ‏2013-05-27T11:26:44Z  

    WAS 8.5 uses and old version of jackson (some one prior to 1.8, I think some kind of 1.7.5).

    I had similar problem with a custom JSON parameter mapper and had to change my implementation form:

    arg = mapper.convertValue(arg, mapper.constructType(parameter.getGenericParameterType()));

    to:

    arg = mapper.convertValue(arg, TypeFactory.type(parameter.getGenericParameterType()));

    Using a deprecated method that currently works on old and new jackson versions.

  • kyhlien
    kyhlien
    1 Post

    Re: Class loader issues in RAD / WAS 8.5.1

    ‏2014-06-16T16:14:07Z  
    Any ideas? Anyone?

    Did you ever get it to work?  I am running into the same issue with an application I am migrating from JBoss to WebSphere.

  • gduser
    gduser
    4 Posts

    Re: Class loader issues in RAD / WAS 8.5.1

    ‏2015-01-17T08:11:04Z  

    WAS v8.x and v8.5.x has alot of problems with libraries that are already included in WAS package.

    Check out RFE

    https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=36945