qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weston M. Price" <wpr...@redhat.com>
Subject Re: Qpid 0.18 JCA under GlassFish 3.1.2.2 only works with LocalTransaction and NoTransaction mode
Date Wed, 05 Dec 2012 17:38:58 GMT

On Dec 5, 2012, at 12:24 PM, "Boyle, Shawn R" <shawn.r.boyle@lmco.com> wrote:

> The Qpid JCA examples default to using XATransaction for the org.apache.qpid.ra.QpidRAConnectionFactory.
We're trying to use the JCA adapter under GlassFish 3.1.2.2 (we were able to deploy the JCA
adapter - I'll share some notes shortly for issues that we encountered trying to deploy and
configure the qpid-ra-0.18.rar JCA under GlassFish 3.1.2.2 - however I'm trying to understand
several things about the Qpid JCA adapter:
> 
> 1. Is the XATransaction mode the preferred mode to use the JCA adapter? In other words,
does Qpid support the Local or No transaction mode? The example's glassfish-resources.xml
has the LocalTransaction ConnectionFactory <connector-connection-pool/> configuration
commented out and the example's README-EXAMPLE.txt states that the "local JMS transaction
CF is currently deprecated" - this implies to me that the LocalTransaction (and I'd assume
the NoTransaction) modes are not supported?
All three modes are technically supported, but LocalTransaction and NoTransaction are not
the default. Due to the way the TxnManager handles XA resources with LocalTransaction commit
optimizations, there is really no need to use the local CF. NoTransaction actually has some
use cases, but again, it is assumed that XA is the default.
> 
> 2. What are the typical use cases for using the XA transaction mode? I don't think we
really need XA for my application but I just might need to become more knowledgeable about
XA with JCA/JMS (as far as I know I thought transactions with JMS is really only to put the
message on the queue (or take a message off the queue) -- each Java EE app server would provide
proprietary features to do things like distributed transactions/propagated transactions/nested
transactions)
The most 'typical' use case would be receiving a message in an MDB and using another XA resource
while processing the message. With XA, this is treated as an atomic transaction so any issues
that may be encountered while processing the message, the receipt of the message can be rolled
back and reprocessed. Most of the time you see this used in conjunction with updating a DB
resource of some sort. If the DB update/commit fails, the message can be redelivered and processed
again. 

Note, there are plenty of other use cases, but this is the one I have seen being used most
frequently. 

If your only using a single resource most of the time the Transaction manager will optimize
this and treat the resource as one phase and bypass the 'prepare' phase off the 2PC protocol.

> 
> When trying to use the XATransaction mode, we get the following errors (I can't provide
the full stacktrace so hopefully this is enough). Our test application is putting a message
onto a Qpid queue from within a JAX-WS web service (successfully), an MDB receives the message
(successfully) and obtains another Connection to publish the message to a "reply" queue (fails
seems to timeout getting a connection), another MDB is supposed to read the messages put on
the "reply" queue (never gets here). Here is some of the errors that we see in the JMS client
log when trying to use the XA transaction (this app works under the Local and No transaction
modes):
Could you tell me which version and flavor of the Broker you are using? Java/C++? Version
number? I have never seen this particular error and I do test on Glassfish so I want to make
sure about the versions etc. Also if you could send me your config at wprice@redhat.com that
would be good as well. 
> 
> ERROR ...[Dispatcher-0-Conn-3, BasicMessageConsumer:notifyMessage] - reNotification :
Caught exception (dump follows) - ignoring...
> java.lang.IllegalArgumentException: range exceeds max received command-id: [1, 1]
>  at org.apache.qpid.transport.Session.processed(Sessoin.java:459)
>  at org.apache.qpid.transport.Session.processed(Sessoin.java:439)
>  at org.apache.qpid.client.AMQSession_0_10.flushProcessed(AMQSesion_0_10.java:313)
>  at org.apache.qpid.client.AMQSession_0_10.messageAcknowledgments(AMQSession_0_10.java:296)
> ...
> 
> ERROR ...[Dispatcher-0-Conn-3, BasicMessageConsumer:notifyMessage] - reNotification :
Caught exception (dump follows) - ignoring...
> java.lang.IllegalStateException: Invalid Session
>  at org.apache.qpid.client.BasicMessageConsumer.checkPreConditions(BasicMessageConsumer.java:890)
> ...
> 
> INFO ...[IoReceiver - <host>, AMQConnection:exceptionReceived] - Not a hard-error
connection not closing: org.apache.qpid.AMQException: ch-1 id=5 ExecutionException(errorCode=ILLEGAL_STATE,
commandId=12, classCode=6, commandCode=4, fieldIndex-0, description=illegal-state: Branch
with xid (Xid: format=4871251; global-id=ETX, errorInfo={}) [error code 409: argument invalid]
> WARN ... [IoReceiver - <host>, QpidExceptionHandler:handleFailure] - Failure in
Qpid activation org.apache.qpid.ra.inflow.QpidActivationSpec(ra=org.apache.qpid.ra.QpidResourceAdapter@ab5491
destination=<qpid dest> destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false
clientID=null user=null maxSession=15 connectionPerHandler=true)
> javax.jms.Exception: Exception thrown against AMQConnection:
> ...
> 
> ERROR ... [Dispatcher-0-Conn-7, QpidRASessionFactoryImpl:allocationConnection] - Could
not create session javax.resource.spi.ResourceAllocationException: Error in allocating a connection.
Cause: org.apache.qpid.transport.SessionException: timed out waiting for session to become
open (state=DETACHED)
>  at com.sun.enterprise.connectors.ConectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:307)
>  ... (more com.sun lines)
>  at org.apache.qpid.ra.QpidRASessionFactoryImpl.allocationConnection(QpidRASessionFactoryImpl.java:850)
>  at org.apache.qpid.ra.QpidRASessionFactoryImpl.createSession(QpidRASessionFactoryImpl.java:483)
>  ... (receive message MDB's onMessage)
> Caused by: com.sun.appserv.connectors.internal.api.PoolingException: org.apache.qpid.transport.SessoinException:
timed out waiting for session to become open (state=DETACHED)
>  at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:221)
> ...
> Caused by: com.sun.appserv.connectors.internal.api.PoolingException: org.apache.qpid.transport.SessoinException:
timed out waiting for session to become open (state=DETACHED)
>  at com.sun.enterprise.resource.rm.ResourceManagerImpl.registerResource(ResourceManagerImpl.java:173)
>  at com.sun.enterprise.resource.rm.ResourceManagerImpl.enlistResource(ResourceManagerImpl.java:112)
> ...
> Caused by: org.apache.qpid.transport.SessionException: timed out waiting for session
to become open (state=DETACHED)
> ...
> 
> ERROR ... [IoReceiver - <host>, AMQConnection:doClose] - error:
> org.apache.qpid.AMQException: close() timed out
> ...
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message