Topic
5 replies Latest Post - ‏2013-08-20T13:49:03Z by Eric_Van_Norman
MandarChatufale
MandarChatufale
18 Posts
ACCEPTED ANSWER

Pinned topic WXS as L2 Cache for Hibernate JPA

‏2013-08-16T11:33:03Z |

Hi,

I am trying to use wxs as L2 cache for Hibernate JPA. I am running my application on WAS - 7. For L2 cache support, i have put the objectgrid.jar in my shared library as my application's hibernate jars are present in shared library.

After putting the jar in shared library, i am getting a Linkage error.

Caused by: java.lang.LinkageError: loading constraint violation: loader "com/ibm/ws/classloader/ExtJarClassLoader@66756675" previously initiated loading for a different type with name "org/osgi/framework/Bundle" defined by loader "org/eclipse/core/launcher/Main$StartupClassLoader@1a3e1a3e"

at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:275)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:74)
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:775)
at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:690)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:531)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
at com.ibm.ejs.ras.BundleResolverImpl.getOSGiResourceBundle(BundleResolverImpl.java:324)
at com.ibm.ejs.ras.BundleResolverImpl.resolve(BundleResolverImpl.java:223)
at com.ibm.ejs.ras.TraceNLS.getResourceBundle(TraceNLS.java:647)
 

Also i tried putting wxshibernate.jar , but getting same exception

Please guide

Thanks

 

 

  • Eric_Van_Norman
    Eric_Van_Norman
    5 Posts
    ACCEPTED ANSWER

    Re: WXS as L2 Cache for Hibernate JPA

    ‏2013-08-16T13:28:19Z  in response to MandarChatufale

    Hello,

    I'm not familiar with Hibernate's class loading and would ask for WAS classloader trace to help identify this issue, but you mention using the objectgrid.jar in your shared library. objectgrid.jar contains WAS classes for those cases when WAS isn't already on the classpath. This will place multiple copies of WAS classes in you class loader hierarchy potentially causing LinkageErrors.

    Since you are running an application in WAS, you should be using wsogclient.jar. Would you replace objectgrid.jar in your shared library with wsogclient.jar and let us know what happens.

    Thanks,

    • MandarChatufale
      MandarChatufale
      18 Posts
      ACCEPTED ANSWER

      Re: WXS as L2 Cache for Hibernate JPA

      ‏2013-08-16T14:42:40Z  in response to Eric_Van_Norman

      Hi,

      Thanks for the prompt reply.

      I replaced objectgrid.jar with wsogclient.jar but even after that it is showing some missing class exception. Some classes from wsogclient.jar refer few classes from objectgrid.jar and then i get ClassNotFoundException

      Please let me know if you need any more information.

      Thanks Again.

       

       

      • Eric_Van_Norman
        Eric_Van_Norman
        5 Posts
        ACCEPTED ANSWER

        Re: WXS as L2 Cache for Hibernate JPA

        ‏2013-08-16T15:02:01Z  in response to MandarChatufale

        Hello,

        You might try wsobjectgrid.jar instead of wsogclient.jar. The former will contain more classes that would be used by server code (as opposed to client code) but still not have the base WAS classes that were involved in the LinkageError.

        Which version of WAS (I know you said 7) and WXS are you using? Is WXS installed on top of WAS or are you just putting the WXS jars in the shared library? Which classes are you seeing the ClassNotFoundException for?

        Thanks,

        • MandarChatufale
          MandarChatufale
          18 Posts
          ACCEPTED ANSWER

          Re: WXS as L2 Cache for Hibernate JPA

          ‏2013-08-19T09:35:21Z  in response to Eric_Van_Norman

          Hi,

          I am just using a standalone version on WXS server. (v8.6)

          Websphere version - 7

          I've not installed WXS on top of WAS. I am using it seperately. That's why i think wsobjectgrid.jar wont be available for me.

          I am putting wsoglient.jar in my shared library.

          wsogclient.jar requires below classes from objectgrid.jar

          - All classes under com.ibm.ws.objectgrid.jpa.cache.common

          ex - JPAPMIModule.class

          Question - Does wsogclient.jar contain all classes which are present in wxshibernate.jar ?

           

           

          • Eric_Van_Norman
            Eric_Van_Norman
            5 Posts
            ACCEPTED ANSWER

            Re: WXS as L2 Cache for Hibernate JPA

            ‏2013-08-20T13:49:03Z  in response to MandarChatufale

            Hello,

            I understand that you are using WXS standalone for the catalog and container servers. You are using WAS as your application server and using WXS client jars within a shared library for your application.

            The missing com.ibm.ws.objectgrid.jpa.cache.common classes are indeed in the wsobjectgrid.jar. I will have to look into whether these classes should indeed be part of the wsogclient jar as well.

            wsogclient.jar does not contain all the wxshibernate.jar classes.

            Thanks,

            Eric