Search code examples
javaserializationcluster-computingmarshallingsession-replication

Identify serialization issues in non-clustered environment


I have a JSF-Spring integrated application. The application works good in my non-cluster environment. When deploy the application in a clustered[wildfly 8.0.0] environment, I face different issues around serialization. Some of the examples are the DTO classes were not implemented Serializable, tries to serialize the Logger class which I don’t want to etc.

The application deployed in clustered environment has the < distributable /> tag in my web.xml so it tries the session replication across nodes and which fails on non-serializable cases.

All developers may not follow the guidelines in these lines, which causes some of these instances.

So my question is what is the best option to see all these serialization issues in my test server[wildfly 8.0.0] which is a non-clustered environment.

Adding one exception details for more clarity:

Caused by: java.lang.RuntimeException: Failure to marshal argument(s)
at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.marshallCall(CommandAwareRpcDispatcher.java:333)
at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.processSingleCall(CommandAwareRpcDispatcher.java:352)
at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommand(CommandAwareRpcDispatcher.java:167)
... 76 more
Caused by: org.infinispan.commons.marshall.NotSerializableException: com.org.account.service.AccountExpServiceImpl
Caused by: an exception which occurred:
in field accountExpService
in field m
in object java.util.HashMap@85b67fbe
in object org.jboss.as.clustering.marshalling.SimpleMarshalledValue@85b67fbe
in object org.infinispan.commands.write.ReplaceCommand@ec0c12ad
in object org.infinispan.commands.tx.PrepareCommand@ce32eb5a

Solution

  • We use the following utility to check whether Infinispan can serialise a given object or not:

    org.infinispan.manager.DefaultCacheManager.getCacheManagerConfiguration().serialization().marshaller().isMarshallable(objectToCheck);

    This is actually part of our tests.