Not able to Send Transactional JMS Messages using Queue in AS8.2PE
Hi there,
I'm migrating a J2EE application from Orion App Server to Sun AP. One of the JMS queues in the app issues messages in a transaction.
This works on Orion, but on Sun I get the following error trying to send a transactional JMS message. I'm using AS8.2PE on windows.
com.sun.messaging.jms.JMSException: [SEND_REPLY(9)] [C4036]: A server error occurred. : transaction failed: Unexpected Broker Exception: [received message with Unknown Transaction ID -1: ignoring message] user=guest, broker=whisper:7676(2967)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.throwServerErrorException(ProtocolHandler.java:3059)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writeJMSMessage(ProtocolHandler.java:1555)
at com.sun.messaging.jmq.jmsclient.WriteChannel.sendWithFlowControl(WriteChannel.java:123)
at com.sun.messaging.jmq.jmsclient.WriteChannel.writeJMSMessage(WriteChannel.java:76)
at com.sun.messaging.jmq.jmsclient.Transaction.send(Transaction.java:128)
at com.sun.messaging.jmq.jmsclient.SessionImpl.writeJMSMessage(SessionImpl.java:683)
at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.writeJMSMessage(MessageProducerImpl.java:155)
at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.writeJMSMessage(MessageProducerImpl.java:145)
at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.send(MessageProducerImpl.java:499)
at com.sun.messaging.jmq.jmsclient.QueueSenderImpl.send(QueueSenderImpl.java:72)
at com.thirddegree.surveys.ejb.IssueSurveysBean.issueMOSurvey(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:957)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:158)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:151)
at $Proxy33.issueMOSurvey(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:167)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
at com.thirddegree.surveys.ejb._IssueSurveys_DynamicStub.issueMOSurvey(_IssueSurveys_DynamicStub.java)
at com.thirddegree.shared.InboundMessageProcessor.issueMOSurvey(Unknown Source)
at com.thirddegree.shared.InboundMessageProcessor.processMobileServiceResponse(Unknown Source)
at com.thirddegree.shared.InboundMessageProcessor.processMessage(Unknown Source)
at com.thirddegree.jms2sms.MessageEventListener.handleEvent(Unknown Source)
at com.logica.smpp.Receiver.process(Receiver.java:440)
at com.logica.smpp.Receiver.receiveAsync(Receiver.java:419)
at com.logica.smpp.ReceiverBase.process(ReceiverBase.java:129)
at com.logica.smpp.util.ProcessingThread.run(ProcessingThread.java:196)
at java.lang.Thread.run(Thread.java:595)
My code is (i already have the session and connection):
// create a transacted session and sender for outbound queue
outboundSession = queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
QueueSender outboundSender = outboundSession.createSender(outboundQueue);
// Start the connection
queueConnection.start();
// send the message out onto the outbound JMS queue
ObjectMessage jmsMessage = outboundSession.createObjectMessage(message);
outboundSender.send(jmsMessage);
// commit JMS transaction
outboundSession.commit();
I'm wondering if this is a bug in AP8.1PE that has not been fixed yet, as i've found this:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6186376
Can anyone please help with this? i need to issue messages in a transaction so need to resolve this some how...
Thanks,
Ed

