Session JBoss EAP 7.0抛出许多JMSRuntimeException
当我向主题发送实体时,我会收到许多JMSRuntimeException。JMSContext是JBoss EAP 7管理的容器。下面是将实体发送到主题和队列的代码。我收到许多StackTrace,我的日志文件在几个小时内超过了30 GB的限制:Session JBoss EAP 7.0抛出许多JMSRuntimeException,session,transactions,jms,jboss7.x,Session,Transactions,Jms,Jboss7.x,当我向主题发送实体时,我会收到许多JMSRuntimeException。JMSContext是JBoss EAP 7管理的容器。下面是将实体发送到主题和队列的代码。我收到许多StackTrace,我的日志文件在几个小时内超过了30 GB的限制: @Inject private JMSContext context; @Resource(name = "java:/jms/topic/my.status.topic") private Topic myStatusTopic; @Resour
@Inject
private JMSContext context;
@Resource(name = "java:/jms/topic/my.status.topic")
private Topic myStatusTopic;
@Resource(name = "java:/jms/queue/my.status.queue")
private Queue myStatusQueue;
public void handleEntities(@Nonnull final MyList myList)
for (ListObject listElement: myList) {
myEntity = new MyEntity();
notifyQueues(myEntity);
}
}
private void notifyQueues(@Nonnull final MyEntity myEntity ) {
try {
JMSProducer producer = context.createProducer();
producer.send(myStatusTopic, myEntity );
producer.send(myStatusQueue, myEntity );
}
catch(JMSRuntimeException e) {
logger.warn("Error while sending: " + e.getMessage());
}
}
这是实体:
@Entity
public class MyChangeEntity implements Serializable {
private static final long serialVersionUID = 1L;
private long id;
private Instant created = Instant.now();
private Integer customVersion;
...
}
这里有一个例外:
javax.ejb.EJBTransactionRolledbackException: javax.jms.JMSRuntimeException: Could not create a session: IJ000460: Error checking for a transaction
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:159) [wildfly-ejb3-7.0.1.GA-redhat-2.jar:7.0.1.GA-redhat-2]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:256) [wildfly-ejb3-7.0.1.GA-redhat-2.jar:7.0.1.GA-redhat-2]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:329) [wildfly-ejb3-7.0.1.GA-redhat-2.jar:7.0.1.GA-redhat-2]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239) [wildfly-ejb3-7.0.1.GA-redhat-2.jar:7.0.1.GA-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-7.0.1.GA-redhat-2.jar:7.0.1.GA-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-7.0.1.GA-redhat-2.jar:7.0.1.GA-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
Caused by: java.lang.RuntimeException: javax.jms.JMSRuntimeException: Could not create a session: IJ000460: Error checking for a transaction
at org.wildfly.extension.messaging.activemq.deployment.JMSContextProducer$JMSContextWrapper.getDelegate(JMSContextProducer.java:234) [wildfly-messaging-activemq-7.0.1.GA-redhat-2.jar:7.0.1.GA-redhat-2]
at org.wildfly.extension.messaging.activemq.deployment.JMSContextProducer$JMSContextWrapper.createProducer(JMSContextProducer.java:267) [wildfly-messaging-activemq-7.0.1.GA-redhat-2.jar:7.0.1.GA-redhat-2]
使用者MDB尝试合并收到的实体。但是合并失败,在回滚时,我收到一个回滚异常:
javax.ejb.EJBTransactionRolledbackException: javax.jms.JMSRuntimeException: Could not create a session: IJ000460: Error checking for a transaction
JBoss EAP 7似乎在会话或检查事务方面存在问题,因为错误经常发生。有人能帮我吗?如果你需要更多的信息,请问我
非常感谢。该方法的上下文中似乎没有活动事务 类配置{{ejbjar.xml}}是如何使用的?它是CDIBean还是ejb 对于特定异常,日志中是否还有一些{{由:}}子句引起 或者事务因某种原因已终止,并且上下文已消失-某种长时间运行的事务因超时而终止-检查事务设置的超时,您的代码已明确回滚事务可能引发RuntimeException。感谢您的回复 问题不在JMS中。这是一个被破坏的数据库事务。因此,数据库事务中的异常是JMSRuntimeException的原因。这不是一个真正的JMS问题