]
Gustavo Fernandes updated ISPN-8568:
------------------------------------
Summary: ClassNotFoundException with Compat mode and deployed Pojos (was:
ClassNotFoundException with Compat mode and custom Pojos)
ClassNotFoundException with Compat mode and deployed Pojos
----------------------------------------------------------
Key: ISPN-8568
URL:
https://issues.jboss.org/browse/ISPN-8568
Project: Infinispan
Issue Type: Bug
Affects Versions: 9.2.0.Alpha1
Reporter: Gustavo Fernandes
Assignee: Gustavo Fernandes
Fix For: 9.2.0.Beta2, 9.2.0.Final
The cache is configured with:
{code:xml}
<cache-container name="local">
<modules>
<module name="deployment.myTask.jar"/>
</modules>
<local-cache name="compat">
<compatibility enabled="true"/>
</local-cache>
</cache-container>
{code}
The {{myTask.jar}} contains Entity.class that is the Pojo to be stored in the cache.
When doing a
{code:java}
remoteCache.put(1, new Entity());
{code}
The error is
{noformat}
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))]
{noformat}
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.