2

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
4

2 回答 2

4

我们使用以下实用程序来检查 Infinispan 是否可以序列化给定对象:

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

这实际上是我们测试的一部分。

于 2015-07-26T17:59:17.710 回答
1

您可以使用不同的配置文件在本地运行应用程序,使用web.xml <distributable/>使用的配置文件和一个用于部署的配置文件,该配置文件已准备好集群,因此带有 <distributable/>标签。如果您使用Maven构建,则需要查看 war 插件和配置文件。请参阅此答案以提供依赖于配置文件的 web.xml

然而,这个解决方案极大地改变了开发环境和生产环境之间的系统行为。仅在部署后发现序列化问题可能代价高昂(就时间和精力而言)。

因此,将序列化问题一一排序是可行的方法。

于 2016-02-09T12:32:46.930 回答