Skip to main content

glassfish v2 genericra + SonicMQ v7.6 XA transacted MDB problem

4 replies [Last post]
serge_poberezhnik
Offline
Joined: 2008-10-24

I try to configure generic resource adapter to SonicMQ 7.6 JMS provider in glassfish v2 as described here https://genericjmsra.dev.java.net/docs/sonic-mq-integration-guide/sonicm....
When no using XA transaction in MDB (TransactionAttributeType.NOT_SUPPORTED) all working fine.
But when i set TransactionAttribute to REQUIRED (default) or REQUIRES_NEW, messages still proceed to MDB, but not properly acknowledged during two-phase transaction commit. It looks like messages appear in sonic queue in JMSRedelivered=true after glassfish shutdown and at next server start that messages are trying to process with MDB again.
I try both ProviderModes: jndi and javabean. Symptoms are the same. No errors in server log. I see my debug message from MDBs onMessage. But message appears in SonicMQ queue after stoping glassfish server. Connection factory was
configured in Sonic JMS administred objects console as XAQueueConnectionFactory type

Does anybody work with XA transactions in glassfish and sonicMQ? In which can
be the problem?
-------------------------------------------------------------------------------------------------------------------

Resource adapter configuration in domain.xml:

Sun-ejb-jar.xml of my MDB is:

TestGF_MDBBean
jms/TestGF_MDBBean

sftImportData/jms/XACF

smqra

ConnectionFactoryJndiName
XAQueueConnectionFactory

JndiProperties
java.naming.factory.initial=com.sonicsw.jndi.mfcontext.MFContextFactory,java.naming.provider.url=tcp://localhost:2506,com.sonicsw.jndi.mfcontext.domain=Domain1,java.naming.security.principal=Administrator,java.naming.security.credentials=password

DestinationJndiName
sftImportData

DestinationType
javax.jms.Queue

UserName
Administrator

Password
sftEventsPassword

MaxPoolSize
30

RedeliveryAttempts
0

RedeliveryInterval
1

ReconnectAttempts
4

ReconnectInterval
1

EndpointReleaseTimeOut
30

server log:

JMS provider is getting the ServerSession
Creating the ServerSession
Created new XA ServerSession
RMPolicy :null
Message provider got the session :XASession
Provider is starting the message consumtion
ProviderIntegrationMode jndi
GenericJMSRA - getInstance() orig com.sun.genericra.GenericJMSRA@5b9aa5ab{ConnectionFactoryClassName = null},{QueueConnectionFactoryClassName = null},{TopicConnectionFactoryClassName = null},{XAConnectionFactoryClassName = null},{XAQueueConnectionFactoryClassName = null},{XATopicConnectionFactoryClassName = null},{QueueClassName = null},{TopicClassName = null},{UnifiedDestinationClassName = null},{ConnectionFactoryProperties = null},{JndiProperties = null},{ProviderIntegrationMode = jndi},{CommonSetterMethodName = null},{SupportsXA = true},{UseFirstXAForRedelivery = false},
Now running the message consumption
Creating message endpoint :
ProviderIntegrationMode jndi
GenericJMSRA - getInstance() orig com.sun.genericra.GenericJMSRA@5b9aa5ab{ConnectionFactoryClassName = null},{QueueConnectionFactoryClassName = null},{TopicConnectionFactoryClassName = null},{XAConnectionFactoryClassName = null},{XAQueueConnectionFactoryClassName = null},{XATopicConnectionFactoryClassName = null},{QueueClassName = null},{TopicClassName = null},{UnifiedDestinationClassName = null},{ConnectionFactoryProperties = null},{JndiProperties = null},{ProviderIntegrationMode = jndi},{CommonSetterMethodName = null},{SupportsXA = true},{UseFirstXAForRedelivery = false},
SimpleXAResourceProxy :Starting tx...TMNOFLAGS
Staring simple inbound transaction 6379626572736C6F6E2C7365727665722C50333730302C000200000080F0652E6379626572736C6F6E2C7365727665722C5033373030
Started simple inbound transaction 6379626572736C6F6E2C7365727665722C50333730302C000200000080F0652E6379626572736C6F6E2C7365727665722C5033373030
Created endpoint :
Message provider got the session :XASession
Consuming the message :progress.message.jimpl.TextMessage@1960a51
Delivery Helper delivering message
Now it is feeding the message to MDB instance
TestGF_MDBBean.onMessage 223: progress.message.jimpl.TextMessage@1960a51
Delivery succedded
SimpleXAResourceProxy :Ending simple inbound transaction TMSUCCESS
Ending simple inbound transaction 6379626572736C6F6E2C7365727665722C50333730302C000200000080F0652E6379626572736C6F6E2C7365727665722C5033373030
Ended simple inbound transaction 6379626572736C6F6E2C7365727665722C50333730302C000200000080F0652E6379626572736C6F6E2C7365727665722C5033373030
Commiting Simple inbound transaction 6379626572736C6F6E2C7365727665722C50333730302C000200000080F0652E6379626572736C6F6E2C7365727665722C5033373030
Commited Simple inbound transaction 6379626572736C6F6E2C7365727665722C50333730302C000200000080F0652E6379626572736C6F6E2C7365727665722C5033373030
InboundJMSResource: released endpoint :
Freed the resource now

source code of my MDB:

@MessageDriven(name="TestGF_MDBBean")
@TransactionManagement(TransactionManagementType.CONTAINER)
public class TestGF_MDBBean implements MessageListener {

@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void onMessage(Message message) {
System.out.println("TestGF_MDBBean.onMessage 223: " + message);
}

}

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
matthiasfraass
Offline
Joined: 2004-07-14

We are facing the [b]exactly[/b] the same Problem!

Messages are back in the Queue when stopping Glassfish.

Please could someone look at this!

Cheers,

Matthias

Edit: (was wrong about the XID)

Message was edited by: matthiasfraass

matthiasfraass
Offline
Joined: 2004-07-14

See the attached stacktrace.
There's a one-phase-commit going on.

matthiasfraass
Offline
Joined: 2004-07-14

...

matthiasfraass
Offline
Joined: 2004-07-14

I was able to resolve this issue by using JMSJCA instead of genericra:
http://www.tricoder.net/blog/?p=144

HTH,

Matthias