I can't explain why - but now it seems to be working as expected -
and the log confirms it. Now I have a new issue that came up while
working on this one - specifically, the url:
jms?jmsURL=failover://(tcp://localhost:61616)
Behaves as expected, but if I attempt to include another broker,
as in:
jms?jmsURL=failover://(tcp://localhost:61616, tcp://
localhost:61617)?randomize=false
JMS Flow fails to initialize with:
Failed to initialize JMSFlow
javax.jms.JMSException: Could not connect to broker URL: failover://
(tcp://localhost:61616. Reason: java.io.IOException: Invalid
location: failover://(tcp://localhost:61616
If the message is any indication, the url appears to be being split
at the comma - I've tried several forms of the url, the amq docs seem
to alternate between failover: and failover:// -- but always the same
result. The upshot is, I can't seem to get servicemix working with
master/slave brokers. I'm sorry - it occurs to me this may well be an
AMQ issue - but if you've ever seen anything like this, please let me
know.
BJ
Full stack trace is:
main 2006-12-11 13:01:24,137 ERROR [JMSFlow:init] Failed to
initialize JMSFlow
javax.jms.JMSException: Could not connect to broker URL: failover://
(tcp://localhost:61616. Reason: java.io.IOException: Invalid
location: failover://(tcp://localhost:61616
at org.apache.activemq.util.JMSExceptionSupport.create
(JMSExceptionSupport.java:32)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
n
(ActiveMQConnectionFactory.java:252)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
n
(ActiveMQConnectionFactory.java:211)
at
org.apache.activemq.ActiveMQConnectionFactory.createConnection
(ActiveMQConnectionFactory.java:158)
at org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow.init
(JMSFlow.java:245)
at org.apache.servicemix.jbi.nmr.DefaultBroker.init
(DefaultBroker.java:135)
at org.apache.servicemix.jbi.container.JBIContainer.init
(JBIContainer.java:556)
at
org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertie
sSe
t(SpringJBIContainer.java:55)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Fac
tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:957)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Fac
tory.initializeBean(AbstractAutowireCapableBeanFactory.java:924)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Fac
tory.createBean(AbstractAutowireCapableBeanFactory.java:415)
at
org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:242)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.g
etSingleton(DefaultSingletonBeanRegistry.java:141)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:239)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:155)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.
pre
InstantiateSingletons(DefaultListableBeanFactory.java:303)
at
org.springframework.context.support.AbstractApplicationContext.refres
h
(AbstractApplicationContext.java:348)
at
org.springframework.web.context.support.AbstractRefreshableWebApplica
tio
nContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
at
org.springframework.web.context.ContextLoader.createWebApplicationCon
tex
t(ContextLoader.java:246)
at
org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(
ContextLoader.java:184)
at
org.springframework.web.context.ContextLoaderListener.contextInitiali
zed
(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart
(StandardContext.java:3763)
at org.apache.catalina.core.StandardContext.start
(StandardContext.java:4211)
at org.apache.catalina.core.ContainerBase.addChildInternal
(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild
(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild
(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory
(HostConfig.java:904)
at org.apache.catalina.startup.HostConfig.deployDirectories
(HostConfig.java:867)
at org.apache.catalina.startup.HostConfig.deployApps
(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start
(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent
(HostConfig.java:310)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start
(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start
(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start
(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start
(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start
(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start
(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:
551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start
(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main
(Bootstrap.java:
432)
Caused by: java.io.IOException: Invalid location: failover://(tcp://
localhost:61616
at
org.apache.activemq.transport.failover.FailoverTransportFactory.doCon
nec
t(FailoverTransportFactory.java:42)
at org.apache.activemq.transport.TransportFactory.doConnect
(TransportFactory.java:42)
at org.apache.activemq.transport.TransportFactory.connect
(TransportFactory.java:76)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
n
(ActiveMQConnectionFactory.java:223)
... 43 more
On Dec 11, 2006, at 12:57 PM, Guillaume Nodet wrote:
> Could you set the org.apache.activemq log level to DEBUG
> in ServiceMix and check if there is an attempt to reconnect ?
>
> On 12/11/06, William Blackburn <[EMAIL PROTECTED]> wrote:
>> I was reading in the Amq docs about clients that can survive short
>> broker outages by connecting using failover transport, even though
>> there was really only one broker.
>>
>> I thought this behavior was ideal for my servicemix app using jms
>> flow, so I set up an external broker, ran it, and setup
servicemix to
>> use:
>>
>> jms?jmsURL=failover:tcp://localhost:61616
>>
>> I also tried:
>>
>> jms?jmsURL=failover://(tcp://localhost:61616)
>>
>> In each case, everything worked fine after the initial startup,
but
>> after restarting the broker, servicemix did not recover and had
to be
>> restarted too. Is this behavior not supported, or have I missed
>> something in configuration?
>>
>> Thanks,
>>
>> BJ
>>
>
>
> --
> Cheers,
> Guillaume Nodet