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

ClassNotFoundException with Compat mode and deployed Pojos

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 9.2.0.Final
    • 9.2.0.Final
    • None
    • None

      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.

              gfernand@redhat.com Gustavo Fernandes (Inactive)
              gfernand@redhat.com Gustavo Fernandes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: