在Wildfly 16中旋转WAR时出现Infinispan NotSerializableException

乔纳森·普特尼

我正在尝试使用该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时,它失败
  • 我的web.xml被标记<distributable/>为所有3个WAR
  • 我的其他缓存似乎可以复制

我似乎无法弄清楚ContextTransactionManager正在哪里使用,或者为什么将其序列化到会话缓存。我假设它可能在我的代码中某个地方,但是我不知道从哪里开始寻找。任何帮助,将不胜感激!

更新(05/28/2019):这是管理控制台的几个屏幕截图,显示了在启动时创建的两个会话(我们在Web应用程序中使用JSP,并且我们有一个启动服务可运行来预编译所有JSP文件):

第一场 第二场

乔纳森·普特尼

更新:首先,这最终是一个非常简单且有些愚蠢的问题。我们在LoggedInUser类中使用@ javax.transaction.Transactional批注标记了一个方法,该批注最初不是必需的,但会导致序列化问题。

只是想发布更新,以防其他人遇到类似情况。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章