【发布时间】:2019-10-09 06:52:23
【问题描述】:
我正在尝试使用 standalone-full-ha.xml 配置在以独立模式运行的 2 个 Wildfly 16 节点上运行我的应用程序。当第二个节点启动时,第一个尝试将默认的web 缓存分配/平衡到新节点。
执行此操作时,我在第一个节点的日志中看到以下错误消息,并且第二个节点无法启动:
13:45:48,487 ERROR [org.infinispan.remoting.rpc.RpcManagerImpl] (transport-thread--p18-t8) ISPN000073: Unexpected error while replicating: org.infinispan.commons.marshall.NotSerializableException: org.wildfly.transaction.client.ContextTransactionManager
Caused by: an exception which occurred:
in field com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorBase.transactionManager
in object com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorRequired@73962bdb
in field org.jboss.weld.contexts.SerializableContextualInstanceImpl.instance
in object org.jboss.weld.contexts.SerializableContextualInstanceImpl@333ebcb5
in object org.jboss.weld.contexts.SerializableContextualInstanceImpl@333ebcb5
in field java.util.Collections$SynchronizedCollection.c
in object java.util.Collections$SynchronizedList@333ebcd4
in field org.jboss.weld.contexts.CreationalContextImpl.dependentInstances
in object org.jboss.weld.contexts.CreationalContextImpl@4dc7055b
in field org.jboss.weld.contexts.SerializableContextualInstanceImpl.creationalContext
in object org.jboss.weld.contexts.SerializableContextualInstanceImpl@57504e37
in object org.jboss.weld.contexts.SerializableContextualInstanceImpl@57504e37
13:45:50,718 ERROR [org.infinispan.statetransfer.OutboundTransferTask] (transport-thread--p18-t8) Failed to send entries to node node2: org.wildfly.transaction.client.ContextTransactionManager: org.infinispan.commons.marshall.NotSerializableException: org.wildfly.transaction.client.ContextTransactionManager
Caused by: an exception which occurred:
in field com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorBase.transactionManager
in object com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorRequired@73962bdb
in field org.jboss.weld.contexts.SerializableContextualInstanceImpl.instance
in object org.jboss.weld.contexts.SerializableContextualInstanceImpl@333ebcb5
in object org.jboss.weld.contexts.SerializableContextualInstanceImpl@333ebcb5
in field java.util.Collections$SynchronizedCollection.c
in object java.util.Collections$SynchronizedList@333ebcd4
in field org.jboss.weld.contexts.CreationalContextImpl.dependentInstances
in object org.jboss.weld.contexts.CreationalContextImpl@4dc7055b
in field org.jboss.weld.contexts.SerializableContextualInstanceImpl.creationalContext
in object org.jboss.weld.contexts.SerializableContextualInstanceImpl@57504e37
in object org.jboss.weld.contexts.SerializableContextualInstanceImpl@57504e37
其他一些注意事项:
- 启动分布在 EAR 中的我的一个 WAR 时失败,但启动也部署在 EAR 中的其他 2 个 WAR 时失败
- 对于所有 3 个 WAR,我的
web.xml都标记为<distributable/> - 我的其他缓存似乎复制得很好
我似乎无法弄清楚ContextTransactionManager 的使用位置,或者为什么我将其序列化到会话缓存中。我假设它可能在我的代码中的某个地方,但我什至不知道从哪里开始寻找。任何帮助将不胜感激!
更新(2019 年 5 月 28 日): 以下是管理控制台的几个屏幕截图,显示了在启动时创建的 2 个会话(我们在 Web 应用程序中使用 JSP,并且我们有一个启动运行以预编译所有 JSP 文件的服务):
【问题讨论】:
-
什么是 Infinispan 版本?你能用 9.4.13.Final 测试一下吗?
-
您确认会话不会存储任何不需要的属性吗?原因“在字段 com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorBase.transactionManager”听起来像是您尝试复制一些内部内容。如果是非 HA 配置文件,它将是本地的,因此不需要序列化
-
@Diego 这是 Wildfly 16 内置的版本,貌似是 9.4.8
-
@wfink 我们不会主动尝试复制用户会话以外的任何内容。我已经用几个屏幕截图更新了描述,这些屏幕截图显示了一些在应用程序启动时创建的默认会话。查看“WELD_S#1”属性,我的猜测是那里有问题,但 LoggedInUser 类只是一个 SessionScoped 托管 bean,它是可序列化的,并且不扩展任何其他类。
标签: jakarta-ee wildfly infinispan weld wildfly-cluster