You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Jörn Kottmann <ko...@gmail.com> on 2009/11/10 02:09:28 UTC

UIMA AS Client with failover broker url which contains randomize option

Hi,

I tried to configure the client with a broker failover url and
got the following exception over at a worker node:
11/10/09 1:39:24 AM - 43: 
org.apache.uima.adapter.jms.activemq.JmsEndpointConnection_impl.openChannel: 
INFO: Controller: XXXX Establishing New Shared Connection To Endpoint: 
ID:XXXXXXX-42012-1257420872886-0:0:2 Managed By Broker: 
tcp://XXX2:61616)?randomize=false
11/10/09 1:39:24 AM - 43: 
org.apache.uima.adapter.jms.activemq.JmsEndpointConnection_impl.handleJmsException: 
INFO: Thread: XXXX Exception:javax.jms.JMSException: Could not create 
Transport. Reason: java.lang.IllegalArgumentException: Invalid connect 
parameters: {randomize=false}

the client then times out on initializing and throws an exception:

Caused by: org.apache.uima.resource.ResourceInitializationException
    at 
org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl.initialize(BaseUIMAAsynchronousEngine_impl.java:637)
    at org.apache.uima.camel.UimaAsProducer.<init>(UimaAsProducer.java:142)
    at 
org.apache.uima.camel.UimaAsEndpoint.createProducer(UimaAsEndpoint.java:89)
    at 
org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:93)
    at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:49)
    at 
org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:42)
    at 
org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:53)
    at 
org.apache.camel.processor.DelegateProcessor.doStart(DelegateProcessor.java:68)
    at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:49)
    at 
org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:42)
    at 
org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:53)
    at 
org.apache.camel.processor.DelegateProcessor.doStart(DelegateProcessor.java:68)
    at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:49)
    at 
org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:42)
    at 
org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:53)
    at 
org.apache.camel.processor.DelegateProcessor.doStart(DelegateProcessor.java:68)
    at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:49)
    at 
org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:42)
    at 
org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:53)
    at 
org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:54)
    at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:49)
    at 
org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:42)
    at 
org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:53)
    at 
org.apache.camel.impl.DefaultConsumer.doStart(DefaultConsumer.java:85)
    at 
org.apache.camel.component.jms.JmsConsumer.doStart(JmsConsumer.java:58)
    at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:49)
    at 
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:422)
    at 
org.apache.camel.impl.DefaultCamelContext.startRoutes(DefaultCamelContext.java:664)
    at 
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:635)
    at 
org.apache.camel.spring.SpringCamelContext.maybeDoStart(SpringCamelContext.java:166)
    at 
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:161)
    at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:49)
    at 
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:96)
    at 
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:115)
    ... 12 more
Caused by: org.apache.uima.aae.error.UimaASMetaRequestTimeout
    ... 46 more

BTW, I think a simple exception message would help here a little to 
bring the error up to the begin of
the stack trace.

The brokerUrl is:
failover:(tcp://XXX1:61616,tcp://XXX2:61616)?randomize=false

Not sure whats going wrong, but I checked that is correctly placed in the
initial param map which is passed to initialize.

The default 4.x activemq was replaced with the 5.3 release version 
through modifying
the ACTIVEMQ_HOME env variable (which just works :-) ).

Jörn


Re: UIMA AS Client with failover broker url which contains randomize option

Posted by Jörn Kottmann <ko...@gmail.com>.
Jörn Kottmann wrote:
> Hi,
>
> I tried to configure the client with a broker failover url and
> got the following exception over at a worker node:
> 11/10/09 1:39:24 AM - 43: 
> org.apache.uima.adapter.jms.activemq.JmsEndpointConnection_impl.openChannel: 
> INFO: Controller: XXXX Establishing New Shared Connection To Endpoint: 
> ID:XXXXXXX-42012-1257420872886-0:0:2 Managed By Broker: 
> tcp://XXX2:61616)?randomize=false
> 11/10/09 1:39:24 AM - 43: 
> org.apache.uima.adapter.jms.activemq.JmsEndpointConnection_impl.handleJmsException: 
> INFO: Thread: XXXX Exception:javax.jms.JMSException: Could not create 
> Transport. Reason: java.lang.IllegalArgumentException: Invalid connect 
> parameters: {randomize=false}
Here is the stack trace for the IlegalArgumentException:

org.apache.uima.aae.error.AsynchAEException: javax.jms.JMSException: 
Could not create Transport. Reason: java.lang.IllegalArgumentException: 
Invalid connect parameters: {randomize=false}
    at 
org.apache.uima.adapter.jms.activemq.JmsEndpointConnection_impl.openChannel(JmsEndpointConnection_impl.java:284)
    at 
org.apache.uima.adapter.jms.activemq.JmsEndpointConnection_impl.openChannel(JmsEndpointConnection_impl.java:147)
    at 
org.apache.uima.adapter.jms.activemq.JmsEndpointConnection_impl.open(JmsEndpointConnection_impl.java:301)
    at 
org.apache.uima.adapter.jms.activemq.JmsEndpointConnection_impl.open(JmsEndpointConnection_impl.java:290)
    at 
org.apache.uima.adapter.jms.activemq.JmsOutputChannel.getEndpointConnection(JmsOutputChannel.java:493)
    at 
org.apache.uima.adapter.jms.activemq.JmsOutputChannel.sendReply(JmsOutputChannel.java:1153)
    at 
org.apache.uima.aae.controller.BaseAnalysisEngineController.sendMetadata(BaseAnalysisEngineController.java:2627)
    at 
org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.sendMetadata(AggregateAnalysisEngineController_impl.java:2585)
    at 
org.apache.uima.aae.handler.input.MetadataRequestHandler_impl.handle(MetadataRequestHandler_impl.java:69)
    at 
org.apache.uima.adapter.jms.activemq.JmsInputChannel.onMessage(JmsInputChannel.java:643)
    at 
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:518)
    at 
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:479)
    at 
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)
    at 
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)
    at 
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)
    at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)
    at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974)
    at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
    at java.lang.Thread.run(Thread.java:619)
Caused by: javax.jms.JMSException: Could not create Transport. Reason: 
java.lang.IllegalArgumentException: Invalid connect parameters: 
{randomize=false}
    at 
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
    at 
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:242)
    at 
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:255)
    at 
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:227)
    at 
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:175)
    at 
org.apache.uima.adapter.jms.activemq.JmsEndpointConnection_impl.openChannel(JmsEndpointConnection_impl.java:195)
    ... 18 more
Caused by: java.lang.IllegalArgumentException: Invalid connect 
parameters: {randomize=false}
    at 
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:144)
    at 
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51)
    at 
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
    at 
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:240)
    ... 22 more


Re: UIMA AS Client with failover broker url which contains randomize option

Posted by Jörn Kottmann <ko...@gmail.com>.
Jörn Kottmann wrote:
> Jörn Kottmann wrote:
>> Jörn Kottmann wrote:
>>> By Broker: tcp://XXX2:61616)?randomize=false
>>>
>>> The brokerUrl is:
>>> failover:(tcp://XXX1:61616,tcp://XXX2:61616)?randomize=false
>>>
>> It looks like that JmsMessageContext.chooseServerUri transform it
>> from
>> failover:(tcp://XXX1:61616,tcp://XXX2:61616)?randomize=false
>> into
>> tcp://XXX2:61616)?randomize=false
>>
>> which is then later rejected.
>>
>> Why does uima tries to select a server uri instead of directly using
>> the broker uri ?
> I just removed the call to chooseServerUri, but I guess that breaks
> the http case ? Not sure what that is about, maybe some who knows the 
> code
> could have a look ?

I did some fail over testing, the setup we have is a pure master slave 
broker.
At the beginning everything is talking to the master until it fails 
(kill -9), then everyone
should talk to the slave instead.

Here is the log from my worker node:

INFO  FailoverTransport              - Successfully connected to 
tcp://XXX1:61616

##### Here I stopped the master broker process with kill -9 #####

WARN  FailoverTransport              - Transport failed to 
tcp://XXX1:61616 , attempting to automatically reconnect due to: 
java.io.EOFException
WARN  FailoverTransport              - Transport failed to 
tcp://XXX1:61616 , attempting to automatically reconnect due to: 
java.io.EOFException
WARN  FailoverTransport              - Transport failed to 
tcp://XXX1:61616 , attempting to automatically reconnect due to: 
java.io.EOFException
INFO  FailoverTransport              - Successfully reconnected to 
tcp://XXX2:61616
INFO  FailoverTransport              - Successfully reconnected to 
tcp://XXX2:61616
INFO  FailoverTransport              - Successfully reconnected to 
tcp://XXX2:61616

The client is reading messages ids from a queue and is then sending them 
in a CAS
to the worker nodes, well through a configuration error the reading 
failed after the master failed.
So I fixed the configuration error and tried to restart the client, but 
it always gets a time out
during initialize. But it sends a message to the uima as queue, but the 
message is not retrieved
by the worker node.

I used the activemq web interface to get some details about the message 
which is never
retrieved:

Command 	2001
MessageFrom 	ID:XXXX-51032-1257865414664-0:1:1
ServerURI 	failover:(tcp://XXX1:61616,tcp://XXX2:61616)?randomize=false
MessageType 	3000


Why does it reconnects three times ? The queue only has 2 consumers on the
activemq web interface.

The log output from activemq is only written to the console not to the 
uima.log file,
has the disadvantage that the time stamp is missing.

Jörn

Re: UIMA AS Client with failover broker url which contains randomize option

Posted by Jörn Kottmann <ko...@gmail.com>.
Jörn Kottmann wrote:
> Jörn Kottmann wrote:
>> By Broker: tcp://XXX2:61616)?randomize=false
>>
>> The brokerUrl is:
>> failover:(tcp://XXX1:61616,tcp://XXX2:61616)?randomize=false
>>
> It looks like that JmsMessageContext.chooseServerUri transform it
> from
> failover:(tcp://XXX1:61616,tcp://XXX2:61616)?randomize=false
> into
> tcp://XXX2:61616)?randomize=false
>
> which is then later rejected.
>
> Why does uima tries to select a server uri instead of directly using
> the broker uri ?
I just removed the call to chooseServerUri, but I guess that breaks
the http case ? Not sure what that is about, maybe some who knows the code
could have a look ?

Jörn

Re: UIMA AS Client with failover broker url which contains randomize option

Posted by Jörn Kottmann <ko...@gmail.com>.
Jörn Kottmann wrote:
> By Broker: tcp://XXX2:61616)?randomize=false
>
> The brokerUrl is:
> failover:(tcp://XXX1:61616,tcp://XXX2:61616)?randomize=false
>
It looks like that JmsMessageContext.chooseServerUri transform it
from
failover:(tcp://XXX1:61616,tcp://XXX2:61616)?randomize=false
into
tcp://XXX2:61616)?randomize=false

which is then later rejected.

Why does uima tries to select a server uri instead of directly using
the broker uri ?

Jörn