0 Replies Latest reply on Aug 22, 2014 7:26 AM by deepak_a

    Query regarding different marshaller/unmarshaller behavior between JAVA SE And JBOSS environment

    deepak_a

      Hi All,


      We use modeshape(3.7.1.Final) and Infinispan(5.2.1.Final).

      We use it in in JavaSE and JBOSS EAP  environment.

      i.e. we write to the JCR via infinispan using JavaSE and read data from JCR using JBOSS EAP.


      We have a problem that when the data is marshall by the JavaSE side can’t be unmarshall in the JBoss Side and found that StreamCorruptedException is raised,

      for more detail information about the exception please refer to the attachment.

       

      After some research and code debug I found that Infinispan will use JBOSS marshaller to marshall/unmarshall the JCR data.

      The root cause  is the instance of ClassResolver  used in the JBoss marshaller is different at runtime between the JavaSE and JBoss EAP .


      1)If the Infinispan with modeshape running in JBoss environment, the instance of ClassResolver is ModularClassResolver.

      2)and If Infinispan with modeshape running in Java SE environment , the instance of ClassResolver is JbossMarshaller#EmbbedContextClassResolver.

       

         There are two methods defined in interface of ClassResolver

      1) annotateClass

      2) annotateProxyClass

       

      When the infinispan is running on the JBoss Environment , ModularClassResolver store class name along with its corresponding module identifier.

       

      So my question is whether we can force the Jboss Marshaller to  use the same instance of the ClassResolver whenever infinispan is running on JBOSS or JAVA SE environment?

       

      (Apologies for cross posting in the Modeshape forum as well - Just in case some one there has encountered this problem before)

       

      regards

      Deepak.