Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-8568

ClassNotFoundException with Compat mode and deployed Pojos

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 9.2.0.Alpha1
    • Fix Version/s: 9.2.0.Beta2, 9.2.0.Final
    • Component/s: None
    • Labels:
      None

      Description

      The cache is configured with:

      <cache-container name="local">
           <modules>
                <module name="deployment.myTask.jar"/>
           </modules>
           <local-cache name="compat">
                <compatibility enabled="true"/>
           </local-cache>
      </cache-container>
      

      The myTask.jar contains Entity.class that is the Pojo to be stored in the cache.

      When doing a

      remoteCache.put(1, new Entity());
      

      The error is

      18:13:42,142 ERROR (main) [TestSuiteProgress] Test failed: LocalServerTestCompatModeIT.shouldRunPriceTask
      org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=9 returned 
      server error (status=0x85): java.lang.ClassNotFoundException: org.infinispan.server.test.Entity from [Module "org.infinispan.commons:main" from 
      local module loader @4ae82894 (finder: local module finder @543788f3 (roots: /home/gfernandes/github/infinispan/server/integration/testsuite/target/server/node1/modules,/home/gfernandes/github/infinispan/server/integration/testsuite/target/server/node1/modules/system/layers/base))]
      

      I noticed that in this case, the Marshaller used is GenericJBossMarshaller who lives in infinispan-commons, and when asked to de-serialize the pojo in byte[] form, the classloader used is ModuleClassLoader for Module "org.infinispan.commons:main" that does not have visibility of the deployed jar's classes.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gfernand@redhat.com Gustavo Fernandes
              Reporter:
              gfernand@redhat.com Gustavo Fernandes
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: