我正在将WAS6应用程序迁移到Liberty配置文件。 在我的项目中,我有一个不在全局事务下的部分,在那里我从一个队列中读取一条消息并将其放入另一个队列中。
为此,我使用了一个事务处理队列会话,最后我做了一个提交方法调用,对于所有异常,我都进行了回滚。
队列会话:
QueueSession session = connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
例外:
com.ibm.msg.client.jms.DetailedIllegelStateException:JMSCC0014:It is not valid to call the 'commit' method on a nontransacted session
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessoImpl.java)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java)
at com.ibm.msg.client.commonservices.j2se.NSLServices.createException(NSLServices.java)
at com.ibm.msg.client.commonservices.nls.NSLServices.createException(NSLServices.java)
at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java)
at com.ibm.msg.client.jms.internal.JmsSessionImpl.commit(JmsSessionImpl.java)
at com.ibm.mq.jms.MQSession.commit(MQSession.java)
at com.ibm.mq.connector.outbound.SessionWrapper.commit(SessionWrapper.java)
at .....my package....JMSHelper.commit(JMSHelper.java)
at .......my code..........(myclass.java)
at ..............mycode............................
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor$ListenerWrapper.handleNotification(DefaultMBeanServerInterceptor.java)
at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java)
at javax.management.NotificationBroadcasterSupport$SendNotifJob.run(NotificationBroadcasterSupport.java)
at javax.management.NotificationBroadcasterSupport$1.execute(NotificationBroadcasterSupport.java)
at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java)
at javax.management.timer.Timer.sendNotification(Timer.java)
at javax.management.timer.TimernotifyAlarmClock(Timer.java)
at javax.management.timer.TimerAlarmClock.run(Timer.java)
at java.util.TimerThread.mainLoop(Timer.java)
at java.util.TimerThread.run(Timer.java)
JMSCC0014:It is not valid to call the 'rollback' method on a nontransacted session
QCF设置
<variable name="wmqJmsClient.rar.location" value="..\path\wmq.jmsra.rar">
<jmsQueueConnectionFactory id="qcfId" jndiName="jms/myQCF" >
<properties.wmqJms channel="mychannel" hostName="myhost" port="1234" queueManager="myQManager" />
</jmsQueueConnectionFactory>
你能告诉我吗。