users@genericjmsra.java.net

Activemq failover protocol in glassfish

From: <kyle_at_pramari.com>
Date: Wed, 19 Jan 2011 23:12:52 +0000 (GMT)

Hi,
I'm attempting to using GenericJMSRA to integrate activemq in
glassfish. I'm having an issue when using the failover protocol as my
brokerURL. I want the brokerURL to look something like this:

brokerURL=failover:(tcp://127.0.0.1:61616,tcp://127.0.0.1:61617)

So when I create the resource adapter config, I do this:

asadmin create-resource-adapter-config --property
SupportsXA=true:RMPolicy=OnePerPhysicalConnection:ProviderIntegrationMo
de=javabean:ConnectionFactoryClassName=org.apache.activemq.ActiveMQConn
ectionFactory:QueueConnectionFactoryClassName=org.apache.activemq.Activ
eMQConnectionFactory:TopicConnectionFactoryClassName=org.apache.activem
q.ActiveMQConnectionFactory:XAConnectionFactoryClassName=org.apache.act
ivemq.ActiveMQXAConnectionFactory:XAQueueConnectionFactoryClassName=org
.apache.activemq.ActiveMQXAConnectionFactory:XATopicConnectionFactoryCl
assName=org.apache.activemq.ActiveMQXAConnectionFactory:UnifiedDestinat
ionClassName=org.apache.activemq.command.ActiveMQDestination:QueueClass
Name=org.apache.activemq.command.ActiveMQQueue:TopicClassName=org.apach
e.activemq.command.ActiveMQTopic:ConnectionFactoryProperties=brokerURL\
=failover\:(tcp\://127.0.0.1\:61616,tcp\://127.0.0.1\:61617):LogLevel=F
INE genericra

I know that's alot of text, but the interesting part is here:

ConnectionFactoryProperties=brokerURL\=failover\:(tcp\://127.0.0.1\:616
16,tcp\://127.0.0.1\:61617)

It seems that there is a problem with the comma, because when I just
supply a single URI, everything works as expected. However, when I
supply two, I get an error message like this:

#|2011-01-19T17:53:36.130-0500|FINE|sun-appserver2.1|com.sun.genericjms
ra|_ThreadID=16;_ThreadName=httpWorkerThread-9648-1;ClassName=com.sun.g
enericra.inbound.ActivationSpec;MethodName=validate;_RequestID=9810fd85
-05fa-40cb-86da-a7970de10952;|com.sun.genericra.inbound.ActivationSpec@
7ca58b69{ConnectionFactoryClassName =
org.apache.activemq.ActiveMQConnectionFactory},{QueueConnectionFactoryC
lassName =
org.apache.activemq.ActiveMQConnectionFactory},{TopicConnectionFactoryC
lassName =
org.apache.activemq.ActiveMQConnectionFactory},{XAConnectionFactoryClas
sName =
org.apache.activemq.ActiveMQXAConnectionFactory},{XAQueueConnectionFact
oryClassName =
org.apache.activemq.ActiveMQXAConnectionFactory},{XATopicConnectionFact
oryClassName =
org.apache.activemq.ActiveMQXAConnectionFactory},{QueueClassName =
org.apache.activemq.command.ActiveMQQueue},{TopicClassName =
org.apache.activemq.command.ActiveMQTopic},{UnifiedDestinationClassName
=
org.apache.activemq.command.ActiveMQDestination},{ConnectionFactoryProp
erties =
brokerURL=failover:(tcp://127.0.0.1:61616,tcp://127.0.0.1:61617)},{Jndi
Properties = null},{ProviderIntegrationMode =
javabean},{CommonSetterMethodName = null},{SupportsXA =
true},{DeliveryType = null},{UseFirstXAForRedelivery =
false},{RedeliveryInterval = 0},{RedeliveryAttempts = 0},{ClientID =
null},{MessageSelector = null},{SubscriptionDurability =
Non-Durable},{ConnectionFactoryJNDIName = null},{SubscriptionName =
null},{DestinationJNDIName = null},{DestinationType =
javax.jms.Queue},{DeadMessageDestinationType =
javax.jms.Destination},{MaxPoolSize = 8},{DestinationProperties =
PhysicalName=mdbQ},{DeadMessageDestinationJndiName =
null},{DeadMessageConnectionFactoryJndiName =
null},{DeadMessageConnectionFactoryProperties =
null},{DeadMessageDestinationClassName =
null},{DeadMessageDestinationProperties = null},{SendBadMessagesToDMD =
false},{EndpointReleaseTimeOut = 180},{InstanceCount =
1},{LoadBalancingRequired = true},{Instance ID =
0},{CustomLoadBalancingMessageSelector = },{ShareClientID =
false}{DeliveryType = null}|#]

[#|2011-01-19T17:53:36.203-0500|FINE|sun-appserver2.1|com.sun.genericjm
sra|_ThreadID=16;_ThreadName=httpWorkerThread-9648-1;ClassName=com.sun.
genericra.util.ObjectBuilder;MethodName=parseToProperties;_RequestID=98
10fd85-05fa-40cb-86da-a7970de10952;|parseToProperties:brokerURL=failove
r:(tcp://127.0.0.1:61616,tcp://127.0.0.1:61617) delimited:,
seperator:=|#]

[#|2011-01-19T17:53:36.208-0500|WARNING|sun-appserver2.1|javax.enterpri
se.system.stream.err|_ThreadID=16;_ThreadName=httpWorkerThread-9648-1;_
RequestID=9810fd85-05fa-40cb-86da-a7970de10952;|java.lang.StringIndexOu
tOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1937)
        at
com.sun.genericra.util.ObjectBuilder.parseToProperties(ObjectBuilder.ja
va:86)
        at
com.sun.genericra.util.ObjectBuilder.build(ObjectBuilder.java:114)
        at
com.sun.genericra.inbound.AbstractConsumer.initializeAdministeredObject
s(AbstractConsumer.java:95)
        at
com.sun.genericra.inbound.AbstractConsumer.<init>(AbstractConsumer.java
:63)
        at
com.sun.genericra.inbound.async.EndpointConsumer.<init>(EndpointConsume
r.java:57)
        at
com.sun.genericra.inbound.EndpointConsumerFactory.createEndpointConsume
r(EndpointConsumerFactory.java:45)
        at
com.sun.genericra.GenericJMSRA.endpointActivation(GenericJMSRA.java:215
)
        at
com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup(C
onnectorMessageBeanClient.java:256)
        at
com.sun.ejb.containers.MessageBeanContainer.<init>(MessageBeanContainer
.java:209)
        at
com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFa
ctoryImpl.java:524)


Just wondering if anyone else has had this issue or can give me any
advice. Thanks,
Kyle