當我將一個實體發送到一個主題時,我得到了很多JMSRuntimeException。 JMSContext是由JBoss EAP 7管理的容器。下面是將實體發送到主題和隊列的代碼。我得到很多的蹤跡和我的日誌文件超過30 GB的在幾個小時的限制:JBoss EAP 7.0引發了許多JMSRuntimeException
@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)試圖合併收到的實體。但合併失敗,回滾我收到RollBackException:
javax.ejb.EJBTransactionRolledbackException: javax.jms.JMSRuntimeException: Could not create a session: IJ000460: Error checking for a transaction
看來,JBoss的EAP 7具有會話或因爲很多時候發生錯誤的交易檢查的問題。有人能幫助我嗎?如果您需要更多信息,請詢問我。
非常感謝。