users@genericjmsra.java.net

Re: Activemq failover protocol in glassfish

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Thu, 20 Jan 2011 12:52:13 +0000

On 19/01/2011 23:13, Kyle Neumeier wrote:
> 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 <http://127.0.0.1:61616>,tcp://127.0.0.1:61617 <http://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:ProviderIntegrationMode=javabean:ConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:QueueConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:TopicConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:XAConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:XAQueueConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:XATopicConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:UnifiedDestinationClassName=org.apache.activemq.command.ActiveMQDestination:QueueClassName=org.apache.activemq.command.ActiveMQQueue:TopicClassName=org.apache.activemq.command.ActiveMQTopic:ConnectionFactoryProperties=brokerURL\=failover\:(tcp\://127.0.0.1
> <http://127.0.0.1>\:61616,tcp\://127.0.0.1 <http://127.0.0.1>\:61617):LogLevel=FINE genericra
>
> I know that's alot of text, but the interesting part is here:
>
> ConnectionFactoryProperties=brokerURL\=failover\:(tcp\://127.0.0.1 <http://127.0.0.1>\:61616,tcp\://127.0.0.1
> <http://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:
ConnectionFactoryProperties is defined as a set of name=value pairs separated by commas. When this is parsed, it is
split at the comma and treated as two separate name=value pairs. Since the second part doesn't contain a = character you
get this exception.

Have you tried escaping the comma with a backslash?

Nigel


>
> #|2011-01-19T17:53:36.130-0500|FINE|sun-appserver2.1|com.sun.genericjmsra|_ThreadID=16;_ThreadName=httpWorkerThread-9648-1;ClassName=com.sun.genericra.inbound.ActivationSpec;MethodName=validate;_RequestID=9810fd85-05fa-40cb-86da-a7970de10952;|com.sun.genericra.inbound.ActivationSpec_at_7ca58b69{ConnectionFactoryClassName
> = org.apache.activemq.ActiveMQConnectionFactory},{QueueConnectionFactoryClassName =
> org.apache.activemq.ActiveMQConnectionFactory},{TopicConnectionFactoryClassName =
> org.apache.activemq.ActiveMQConnectionFactory},{XAConnectionFactoryClassName =
> org.apache.activemq.ActiveMQXAConnectionFactory},{XAQueueConnectionFactoryClassName =
> org.apache.activemq.ActiveMQXAConnectionFactory},{XATopicConnectionFactoryClassName =
> org.apache.activemq.ActiveMQXAConnectionFactory},{QueueClassName =
> org.apache.activemq.command.ActiveMQQueue},{TopicClassName =
> org.apache.activemq.command.ActiveMQTopic},{UnifiedDestinationClassName =
> org.apache.activemq.command.ActiveMQDestination},{ConnectionFactoryProperties =
> brokerURL=failover:(tcp://127.0.0.1:61616 <http://127.0.0.1:61616>,tcp://127.0.0.1:61617)},{JndiProperties =
> 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.genericjmsra|_ThreadID=16;_ThreadName=httpWorkerThread-9648-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=parseToProperties;_RequestID=9810fd85-05fa-40cb-86da-a7970de10952;|parseToProperties:brokerURL=failover:(tcp://127.0.0.1:61616
> <http://127.0.0.1:61616>,tcp://127.0.0.1:61617 <http://127.0.0.1:61617>) delimited:, seperator:=|#]
>
> [#|2011-01-19T17:53:36.208-0500|WARNING|sun-appserver2.1|javax.enterprise.system.stream.err|_ThreadID=16;_ThreadName=httpWorkerThread-9648-1;_RequestID=9810fd85-05fa-40cb-86da-a7970de10952;|java.lang.StringIndexOutOfBoundsException:
> String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at com.sun.genericra.util.ObjectBuilder.parseToProperties(ObjectBuilder.java:86)
> at com.sun.genericra.util.ObjectBuilder.build(ObjectBuilder.java:114)
> at com.sun.genericra.inbound.AbstractConsumer.initializeAdministeredObjects(AbstractConsumer.java:95)
> at com.sun.genericra.inbound.AbstractConsumer.<init>(AbstractConsumer.java:63)
> at com.sun.genericra.inbound.async.EndpointConsumer.<init>(EndpointConsumer.java:57)
> at com.sun.genericra.inbound.EndpointConsumerFactory.createEndpointConsumer(EndpointConsumerFactory.java:45)
> at com.sun.genericra.GenericJMSRA.endpointActivation(GenericJMSRA.java:215)
> at com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:256)
> at com.sun.ejb.containers.MessageBeanContainer.<init>(MessageBeanContainer.java:209)
> at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:524)
>
>
> Just wondering if anyone else has had this issue or can give me any advice.
>
> Thanks,
> Kyle
>