wildfly上的spring defaultmessagelistenercontainer异常:跨边界连接

rqcrx0a6  于 2021-07-23  发布在  Java
关注(0)|答案(0)|浏览(328)

我在wildfly18(jdk11)上部署了一个springboot应用程序(v2.1.9)作为war文件。在研究一些事务问题时,我在wildfly上启动了日志记录,并开始反复看到下面的堆栈跟踪。

2021-02-19 05:08:52,427 TRACE [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (DefaultMessageListenerContainer-1) ConnectionListener=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@135297ce[state=NORMAL managed connection=org.apache.activemq.artemis.ra.ActiveMQRAManagedConnection@33ec2c9b connection handles=1 lastReturned=1613729330421 lastValidated=1613685971189 lastCheckedOut=1613729330421 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri@4cdfeb mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@2ba3164b[pool=ActiveMQConnectionDefinition] xaResource=XAResourceWrapperImpl@97c94eb[xaResource=org.jboss.activemq.artemis.wildfly.integration.WildFlyActiveMQXAResourceWrapper@1eef2b9a pad=false overrideRmValue=null productName=ActiveMQ Artemis productVersion=2.0 jndiName=java:/JmsXA NodeId:720ee576-155e-11eb-8f88-00155dcf8996] txSync=null]: java.lang.Exception: Connection across boundary
    at org.jboss.ironjacamar.impl@1.4.17.Final//org.jboss.jca.core.connectionmanager.listener.TxConnectionListener$TransactionSynchronization.afterCompletion(TxConnectionListener.java:1190)
    at org.jboss.ironjacamar.impl@1.4.17.Final//org.jboss.jca.core.connectionmanager.transaction.TransactionSynchronizer.invokeAfter(TransactionSynchronizer.java:456)
    at org.jboss.ironjacamar.impl@1.4.17.Final//org.jboss.jca.core.connectionmanager.transaction.TransactionSynchronizer.afterCompletion(TransactionSynchronizer.java:392)
    at org.jboss.as.transactions@18.0.1.Final//org.jboss.as.txn.service.internal.tsr.JCAOrderedLastSynchronizationList.afterCompletion(JCAOrderedLastSynchronizationList.java:160)
    at org.wildfly.transaction.client@1.1.7.Final//org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:223)
    at org.wildfly.transaction.client@1.1.7.Final//org.wildfly.transaction.client.AbstractTransaction$AssociatingSynchronization.afterCompletion(AbstractTransaction.java:306)
    at org.jboss.jts//com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:96)
    at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:545)
    at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:101)
    at org.jboss.jts//com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
    at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1287)
    at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
    at org.jboss.jts.integration//com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:94)
    at org.wildfly.transaction.client@1.1.7.Final//org.wildfly.transaction.client.LocalTransaction.commitAndDissociate(LocalTransaction.java:75)
    at org.wildfly.transaction.client@1.1.7.Final//org.wildfly.transaction.client.ContextTransactionManager.commit(ContextTransactionManager.java:71)
    at org.wildfly.transaction.client@1.1.7.Final//org.wildfly.transaction.client.LocalUserTransaction.commit(LocalUserTransaction.java:53)
    at deployment.war//org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1035)
    at deployment.war//org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:746)
    at deployment.war//org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:714)
    at deployment.war//org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:251)
    at deployment.war//org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1190)
    at deployment.war//org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1180)
    at deployment.war//org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1077)
    at java.base/java.lang.Thread.run(Thread.java:834)

我的spring配置是

public ConnectionFactory connectionFactory() throws Exception {
    JndiObjectFactoryBean jndiObjectFactoryBean = new JndiObjectFactoryBean();
    jndiObjectFactoryBean.setJndiName(xaConnectionName);
    jndiObjectFactoryBean.afterPropertiesSet();
    return (ConnectionFactory) jndiObjectFactoryBean.getObject();
}

public JmsListenerContainerFactory<?> jmsFactory(DefaultJmsListenerContainerFactoryConfigurer configurer) throws Exception {
    DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
    factory.setConcurrency(asyncPoolSize);
    factory.setReceiveTimeout(asyncReceiveTimeout);
    factory.setSessionTransacted(true);
    factory.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);
    factory.setMessageConverter(simpleMessageConverter());
    factory.setTransactionManager(transactionManager);
    configurer.configure(factory, connectionFactory());
    return factory;
}

这似乎是spring的一个相当标准的配置,但显然wildfly反对这个实现。我找到了这个讨论这个问题的帖子。http://www.ironjacamar.org/doc/roadto12/txtracking.html
我意识到这只是一个跟踪日志语句,但我想了解潜在的问题。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题