Discussion:
WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability
(too old to reply)
m***@gmail.com
2006-11-29 13:18:34 UTC
Permalink
I am getting the following error when I try to access a message through JMS call, I am making this call from commerce command and not from MDB, I don't have any database operations in the method, that is I am not connecting to database. I am just getting the connection factory using JNDI and Queue.
When I invoke QueueReciver.receive() method I am getting this error. My Configuration to connection and Queue is not enabled with XA. Any hlep to fix this problem, really appreciated.

The Code Snippet is as follows

ic = new InitialContext();
QueueConnectionFactory qcf = (QueueConnectionFactory)ic.lookup(jndiQMgr);
QueueConnection qc = qcf.createQueueConnection();
//qc.start();
QueueSession qs = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue)ic.lookup(jndiQName);
QueueReceiver queueReceiver = qs.createReceiver(q);
System.out.println( "QUEUE NAME "+q.getQueueName());
qc.start();
Message m = queueReceiver.receive();

This is the Error
WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction.

Thks
C
geo
2006-11-29 19:47:25 UTC
Permalink
reading messages directly as you mention is an example of using multiple
resources. This sounds like it is probably being kicked off from a
Controller or Task commands which sets a transaction context and what you
are trying to do would constitute more than one resource (db being the
primary)
Post by m***@gmail.com
I am getting the following error when I try to access a message through JMS
call, I am making this call from commerce command and not from MDB, I don't
have any database operations in the method, that is I am not connecting to
database. I am just getting the connection factory using JNDI and Queue.
When I invoke QueueReciver.receive() method I am getting this error. My
Configuration to connection and Queue is not enabled with XA. Any hlep to
fix this problem, really appreciated.
The Code Snippet is as follows
ic = new InitialContext();
QueueConnectionFactory qcf =
(QueueConnectionFactory)ic.lookup(jndiQMgr);
QueueConnection qc = qcf.createQueueConnection();
//qc.start();
QueueSession qs = qc.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue)ic.lookup(jndiQName);
QueueReceiver queueReceiver = qs.createReceiver(q);
System.out.println( "QUEUE NAME "+q.getQueueName());
qc.start();
Message m = queueReceiver.receive();
This is the Error
WTRN0062E: An illegal attempt to use multiple resources that have only
one-phase capability has occurred within a global transaction.
Thks
C
m***@gmail.com
2006-11-29 20:44:44 UTC
Permalink
I got it, thanks for you response. Is there any other option other than enabling XA interface which allows two phase commit. I want this JMS Call to be in a command, so that I can have schedular job to kickoff this command.
Loading...