users@glassfish.java.net

glassfish, openmq, spring?

From: Kristian Rink <lists_at_zimmer428.net>
Date: Thu, 02 Jul 2009 16:07:33 +0200

Folks;

anyone out here using Spring+Glassfish+OpenMQ successfully along with each
other? Somehow I spent quite some time today dealing with configuring both
Springs applicationContext.xml and the Glassfish application server JMS
resources and figured out the following:

- Recieving topic messages in a Spring bean works flawlessly after some
initial tweaking.

- Publishing topic messages from a Spring servlet, however, ends up in
various different exceptions, depending upon Spring application (and
server?) configuration in a particular arcane way (which I haven't yet
completely figured out). Examples are


[...]
Caused by: com.sun.messaging.jms.JMSException: [SEND_REPLY(9)] [C4036]: A
broker error occurred. :[500] transaction failed: Unexpected Broker
Exception: [received message with Unknown Transaction ID -1: ignoring
message] user=guest, broker=localhost:7676(36470)
        at
com.sun.messaging.jmq.jmsclient.ProtocolHandler.throwServerErrorException(ProtocolHandler.java:3982)
        at
com.sun.messaging.jmq.jmsclient.ProtocolHandler.writeJMSMessage(ProtocolHandler.java:1962)
        at
com.sun.messaging.jmq.jmsclient.WriteChannel.sendWithFlowControl(WriteChannel.java:154)
[...]


... or ...


[...]
Caused by: com.sun.messaging.jms.JMSException: MQRA:CA:createSession
failed-Only one JMS Session allowed when managed connection is involved in a
transaction
        at
com.sun.messaging.jms.ra.ConnectionAdapter.createSession(ConnectionAdapter.java:372)
        at sun.reflect.GeneratedMethodAccessor557.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
[...]


So to ask: Has anyone so far got a Spring application to cleanly work with
Glassfishs internal openmq (running in LOCAL mode by the way, in a
non-clustered server) and is willing to share her/his experiences? Would be
greatly appreciated... :)

TIA and all the best,
Kristian