[infinispan-issues] [JBoss JIRA] (ISPN-4468) HR client is not able to unmarshall custom class when using AS modules
Galder Zamarreño (JIRA)
issues at jboss.org
Fri Sep 19 02:43:02 EDT 2014
[ https://issues.jboss.org/browse/ISPN-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004128#comment-13004128 ]
Galder Zamarreño commented on ISPN-4468:
----------------------------------------
Vojtech, what's the HR client being executed from? IOW, what kind of deployment is it running within? Looking at the test class I see no other deployments other than the filter/converter deployments, which are specific to HR event filter/converter tests.
If the test class, and custom class are running as if they were in a JBoss module, they'd be some module hardwiring required to make this work. There's no way to get around that. On the contrary, if the test class and custom class are inside a WAR/EAR, the application server will do what it needs to do to make sure that the custom class is visible: https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7
Finally, rather than AbstractRemoteCacheIT, a test that's closer to what you are trying to do of marshalling a custom object is {{org.infinispan.test.integration.as.HotRodClientIT}}, where you have a remote HR client running within JBoss, using Infinispan Server modules which include HR client, hooked in Wildfly, and then have HotRodClientIT run inside a WAR in Wildfly. If you add a test to marshall custom classes there, it should work.
> HR client is not able to unmarshall custom class when using AS modules
> ----------------------------------------------------------------------
>
> Key: ISPN-4468
> URL: https://issues.jboss.org/browse/ISPN-4468
> Project: Infinispan
> Issue Type: Bug
> Components: Marshalling, Remote Protocols
> Reporter: Vojtech Juranek
> Assignee: Galder Zamarreño
> Fix For: 7.0.0.Final
>
>
> When using HR client in JBoss and use JBoss modules for HR client, storing custom objects into remote cache works, however when custom objects is read back from remote cache, it fails as {{ClassNotFoundException}}:
> {noformat}
> testPutGetCustomObject(com.jboss.datagrid.test.hotrod.HotRodRemoteCacheIT) Time elapsed: 1.749 sec <<< ERROR!
> org.infinispan.client.hotrod.exceptions.HotRodClientException: Unable to unmarshall byte stream
> at org.infinispan.client.hotrod.impl.RemoteCacheImpl.bytes2obj(RemoteCacheImpl.java:555)
> at org.infinispan.client.hotrod.impl.RemoteCacheImpl.get(RemoteCacheImpl.java:425)
> at org.infinispan.server.test.client.hotrod.AbstractRemoteCacheIT.testPutGetCustomObject(AbstractRemoteCacheIT.java:746)
> {noformat}
> [...]
> {noformat}
> Caused by: java.lang.ClassNotFoundException: org.infinispan.server.test.client.hotrod.AbstractRemoteCacheIT$Person from [Module "org.infinispan.commons:jdg-6.3" from local module loader @5cbf5bb7 (finder: local module finder @171e7af3 (roots: /opt/test_servers/jboss-eap-6.2.2/modules,/opt/test_servers/jboss-eap-6.2.2/modules/system/layers/base))]
> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
> at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:270)
> at org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:131)
> at org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:112)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:943)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1239)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
> at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
> at org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller.objectFromObjectStream(AbstractJBossMarshaller.java:135)
> at org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller.objectFromByteBuffer(AbstractJBossMarshaller.java:113)
> at org.infinispan.commons.marshall.AbstractMarshaller.objectFromByteBuffer(AbstractMarshaller.java:82)
> at org.infinispan.client.hotrod.impl.RemoteCacheImpl.bytes2obj(RemoteCacheImpl.java:553)
> at org.infinispan.client.hotrod.impl.RemoteCacheImpl.get(RemoteCacheImpl.java:425)
> at org.infinispan.server.test.client.hotrod.AbstractRemoteCacheIT.testPutGetCustomObject(AbstractRemoteCacheIT.java:746)
> {noformat}
> Adding jar file with {{org.infinispan.server.test.client.hotrod.AbstractRemoteCacheIT$Person}} into jboss-deployment-structure as a module didn't helped.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
More information about the infinispan-issues
mailing list