2

我正在尝试使用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 时失败,但不是其他 2 个也部署在 EAR 中的 WAR
  • web.xml的标记<distributable/>为所有 3 WAR
  • 我的其他缓存似乎复制得很好

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

更新(2019 年 5 月 28 日):以下是管理控制台的几个屏幕截图,显示了在启动时创建的 2 个会话(我们在 Web 应用程序中使用 JSP,并且我们有一个启动服务来预编译所有JSP 文件):

第 1 节 第 2 节

4

1 回答 1

0

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

只是想发布一个更新,以防其他人遇到类似的事情。

于 2019-05-30T18:16:14.970 回答