[mule-user] ActiveMQ Spring namespace configuration for embedded broker results in port bind exception

3 views
Skip to first unread message

aswin.nair

unread,
Dec 9, 2009, 1:44:56 PM12/9/09
to us...@mule.codehaus.org

Hello I have the following mule config file (stripped off all unwanted
stuff), but while starting up this it gives me a "java.net.BindException:
Address already in use: JVM_Bind" exception.
http://old.nabble.com/file/p26715377/activemq-mule-config.xml
activemq-mule-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.mulesource.org/schema/mule/core/2.2"
xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.2"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.mulesource.org/schema/mule/core/2.2
http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
http://www.mulesource.org/schema/mule/vm/2.2
http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd
http://www.mulesource.org/schema/mule/jersey/2.2
http://www.mulesource.org/schema/mule/jersey/2.2/mule-jersey.xsd
http://www.mulesource.org/schema/mule/http/2.2
http://www.mulesource.org/schema/mule/http/2.2/mule-http.xsd
http://www.mulesource.org/schema/mule/jms/2.2
http://www.mulesource.org/schema/mule/jms/2.2/mule-jms.xsd
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd">

<jms:activemq-connector name="jmsConnector"
brokerURL="tcp://localhost:9876" specification="1.1" />

<spring:beans>
<amq:broker useJmx="false" persistent="false">
<amq:transportConnectors>
<amq:transportConnector uri="tcp://localhost:9876" />
</amq:transportConnectors>
</amq:broker>
</spring:beans>

</mule>


Digging around the code points to the direction that both the
XBeanNameSpaceHandler and the MuleHierarchicalBeanDefinitionParserDelegate
are trying to register the same broker bean twice and this causes the
binding exception for the second instance.

The following lines in the method
MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(Element
element, BeanDefinition parent) is where this issue happens as far I can
see. The handler.parse() delegates to the XBeanNameSpaceHandler which
actually registers the bean, but the mule namespace handler also does that
in the "registerBean" call.

finalChild = handler.parse(element, parserContext);
registerBean(element, finalChild);

--
View this message in context: http://old.nabble.com/ActiveMQ-Spring-namespace-configuration-for-embedded-broker-results-in-port-bind-exception-tp26715377p26715377.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


David Dossot

unread,
Dec 9, 2009, 3:11:44 PM12/9/09
to us...@mule.codehaus.org
Can you please try with:

  <jms:activemq-connector name="jmsConnector" brokerURL="tcp://localhost:9876?create=false"  specification="1.1"  />

With this, the AMQ connector will not attempt to start a broker.

HTH,
D.

Andrew Perepelytsya

unread,
Dec 9, 2009, 3:16:45 PM12/9/09
to us...@mule.codehaus.org
Actually, brokerURL as specified will point to an external amq instance. Post stacktrace please.

Andrew

aswin.nair

unread,
Dec 9, 2009, 3:36:33 PM12/9/09
to us...@mule.codehaus.org

David Dossot-3 wrote:
>
> Can you please try with:
>
> <jms:activemq-connector
> name="jmsConnector" brokerURL="tcp://localhost:9876?create=false"
> specification="1.1" />
>
> With this, the AMQ connector will not attempt to start a broker.
>

Tried this and exact same issue prevails.
--
View this message in context: http://old.nabble.com/ActiveMQ-Spring-namespace-configuration-for-embedded-broker-results-in-port-bind-exception-tp26715377p26717258.html

David Dossot

unread,
Dec 9, 2009, 3:38:38 PM12/9/09
to us...@mule.codehaus.org
As Andrew said, forget what I said and please do post a tasty stackfest ;)

D.

aswin.nair

unread,
Dec 9, 2009, 3:53:35 PM12/9/09
to us...@mule.codehaus.org

David Dossot-3 wrote:
>
> As Andrew said, forget what I said and please do post a tasty stackfest ;)
>

Here it is , in its full glory :)

[09/12/09 02:50:35:035 CST] INFO spring.MuleApplicationContext: Refreshing
org.mule.config.spring.MuleApplicationContext@16f0be8: display name
[org.mule.config.spring.MuleApplicationContext@16f0be8]; startup date [Wed
Dec 09 14:50:35 CST 2009]; root of context hierarchy
[09/12/09 02:50:35:035 CST] INFO xml.XmlBeanDefinitionReader: Loading XML
bean definitions from default-mule-config.xml
[09/12/09 02:50:35:035 CST] INFO support.DefaultListableBeanFactory:
Overriding bean definition for bean '_muleConfiguration': replacing [Generic
bean: class [org.mule.config.spring.MuleConfigurationConfigurator];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0;
dependencyCheck=0; autowireCandidate=true; primary=false;
factoryBeanName=null; factoryMethodName=null; initMethodName=initialise;
destroyMethodName=null; defined in default-mule-config.xml] with [Generic
bean: class [org.mule.config.spring.MuleConfigurationConfigurator];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0;
dependencyCheck=0; autowireCandidate=true; primary=false;
factoryBeanName=null; factoryMethodName=null; initMethodName=initialise;
destroyMethodName=null; defined in default-mule-config.xml]
[09/12/09 02:50:35:035 CST] INFO support.DefaultListableBeanFactory:
Overriding bean definition for bean '_muleConfiguration': replacing [Generic
bean: class [org.mule.config.spring.MuleConfigurationConfigurator];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0;
dependencyCheck=0; autowireCandidate=true; primary=false;
factoryBeanName=null; factoryMethodName=null; initMethodName=initialise;
destroyMethodName=null; defined in default-mule-config.xml] with [Generic
bean: class [org.mule.config.spring.MuleConfigurationConfigurator];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0;
dependencyCheck=0; autowireCandidate=true; primary=false;
factoryBeanName=null; factoryMethodName=null; initMethodName=initialise;
destroyMethodName=null; defined in default-mule-config.xml]
[09/12/09 02:50:35:035 CST] INFO support.DefaultListableBeanFactory:
Overriding bean definition for bean '_muleNotificationManager': replacing
[Generic bean: class
[org.mule.config.spring.ServerNotificationManagerConfigurator];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0;
dependencyCheck=0; autowireCandidate=true; primary=false;
factoryBeanName=null; factoryMethodName=null; initMethodName=initialise;
destroyMethodName=null; defined in default-mule-config.xml] with [Generic
bean: class [org.mule.config.spring.ServerNotificationManagerConfigurator];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0;
dependencyCheck=0; autowireCandidate=true; primary=false;
factoryBeanName=null; factoryMethodName=null; initMethodName=initialise;
destroyMethodName=null; defined in default-mule-config.xml]
[09/12/09 02:50:35:035 CST] INFO support.DefaultListableBeanFactory:
Overriding bean definition for bean '_muleNotificationManager': replacing
[Generic bean: class
[org.mule.config.spring.ServerNotificationManagerConfigurator];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0;
dependencyCheck=0; autowireCandidate=true; primary=false;
factoryBeanName=null; factoryMethodName=null; initMethodName=initialise;
destroyMethodName=null; defined in default-mule-config.xml] with [Generic
bean: class [org.mule.config.spring.ServerNotificationManagerConfigurator];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0;
dependencyCheck=0; autowireCandidate=true; primary=false;
factoryBeanName=null; factoryMethodName=null; initMethodName=initialise;
destroyMethodName=null; defined in default-mule-config.xml]
[09/12/09 02:50:35:035 CST] INFO support.DefaultListableBeanFactory:
Overriding bean definition for bean '_muleSystemModel': replacing [Root
bean: class [org.mule.model.seda.SedaModel]; scope=singleton;
abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0;
autowireCandidate=true; primary=false; factoryBeanName=null;
factoryMethodName=null; initMethodName=initialise;
destroyMethodName=dispose] with [Root bean: class
[org.mule.model.seda.SedaModel]; scope=singleton; abstract=false;
lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true;
primary=false; factoryBeanName=null; factoryMethodName=null;
initMethodName=initialise; destroyMethodName=dispose]
[09/12/09 02:50:35:035 CST] INFO xml.XmlBeanDefinitionReader: Loading XML
bean definitions from activemq-mule-config.xml
[09/12/09 02:50:35:035 CST] INFO support.DefaultListableBeanFactory:
Overriding bean definition for bean 'jmsConnector': replacing [Root bean:
class [org.mule.transport.jms.activemq.ActiveMQJmsConnector];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0;
dependencyCheck=0; autowireCandidate=true; primary=false;
factoryBeanName=null; factoryMethodName=null; initMethodName=initialise;
destroyMethodName=dispose] with [Root bean: class
[org.mule.transport.jms.activemq.ActiveMQJmsConnector]; scope=singleton;
abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0;
autowireCandidate=true; primary=false; factoryBeanName=null;
factoryMethodName=null; initMethodName=initialise;
destroyMethodName=dispose]
[09/12/09 02:50:36:036 CST] INFO spring.MuleApplicationContext: Bean
factory for application context
[org.mule.config.spring.MuleApplicationContext@16f0be8]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@1f78b68
[09/12/09 02:50:36:036 CST] INFO support.DefaultListableBeanFactory:
Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1f78b68:
defining beans
[customEditorConfigurer,_muleObjectNameProcessor,_mulePropertyPlaceholderProcessor,_muleSimpleRegistryBootstrap,_muleNotificationManager,_muleConfiguration,._muleNotificationManager:notification.1,._muleNotificationManager:notification.2,._muleNotificationManager:notification.3,._muleNotificationManager:notification.4,._muleNotificationManager:notification.5,._muleNotificationManager:notification.6,._muleNotificationManager:notification.7,._muleNotificationManager:notification.8,._muleNotificationManager:notification.9,._muleNotificationManager:notification.10,_muleSystemModel,_muleQueueManager,_muleSecurityManager,_muleProperties,_muleEndpointFactory,_muleStreamCloserService,_defaultThreadingProfile,_defaultMessageDispatcherThreadingProfile,_defaultMessageRequesterThreadingProfile,_defaultMessageReceiverThreadingProfile,_defaultServiceThreadingProfile,_defaultRetryPolicyTemplate,jmsConnector,.:transportConnector,org.apache.activemq.xbean.XBeanBrokerService#0,.:broker];
root of factory hierarchy
[09/12/09 02:50:36:036 CST] INFO activemq.ActiveMQJmsConnector:
Initialising: ActiveMQJmsConnector{this=61373f, started=false,
initialised=false, name='jmsConnector', disposed=false,
numberOfConcurrentTransactedReceivers=4,
createMultipleTransactedReceivers=true, connected=false,
supportedProtocols=[jms], serviceOverrides=null}
[09/12/09 02:50:36:036 CST] INFO mule.DefaultExceptionStrategy:
Initialising exception listener: org.mule.DefaultExceptionStrategy@19e09a4
[09/12/09 02:50:36:036 CST] INFO broker.BrokerService: Using Persistence
Adapter: MemoryPersistenceAdapter
[09/12/09 02:50:36:036 CST] INFO broker.BrokerService: ActiveMQ 5.3.0 JMS
Message Broker (localhost) is starting
[09/12/09 02:50:36:036 CST] INFO broker.BrokerService: For help or more
information please see: http://activemq.apache.org/
[09/12/09 02:50:36:036 CST] INFO transport.TransportServerThreadSupport:
Listening for connections at: tcp://localhost:9876
[09/12/09 02:50:36:036 CST] INFO broker.TransportConnector: Connector
tcp://localhost:9876 Started
[09/12/09 02:50:36:036 CST] INFO broker.BrokerService: ActiveMQ JMS Message
Broker (localhost, ID:LHX002CE931H8C2-4669-1260391836425-0:0) started
[09/12/09 02:50:36:036 CST] INFO broker.BrokerService: Using Persistence
Adapter: MemoryPersistenceAdapter
[09/12/09 02:50:36:036 CST] INFO broker.BrokerService: ActiveMQ 5.3.0 JMS
Message Broker (localhost) is starting
[09/12/09 02:50:36:036 CST] INFO broker.BrokerService: For help or more
information please see: http://activemq.apache.org/
[09/12/09 02:50:36:036 CST] ERROR broker.BrokerService: Failed to start
ActiveMQ JMS Message Broker. Reason: java.io.IOException: Failed to bind to
server socket: tcp://localhost:9876 due to: java.net.BindException: Address
already in use: JVM_Bind
java.io.IOException: Failed to bind to server socket: tcp://localhost:9876
due to: java.net.BindException: Address already in use: JVM_Bind
at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
at
org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:139)
at
org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:60)
at
org.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:131)
at
org.apache.activemq.broker.TransportConnector.createTransportServer(TransportConnector.java:304)
at
org.apache.activemq.broker.TransportConnector.getServer(TransportConnector.java:133)
at
org.apache.activemq.broker.TransportConnector.start(TransportConnector.java:193)
at
org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:1961)
at
org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:1911)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:471)
at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at
org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:68)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at
org.mule.config.builders.WebappMuleXmlConfigurationBuilder.doConfigure(WebappMuleXmlConfigurationBuilder.java:82)
at
org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
at
org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
at
org.mule.config.builders.MuleXmlBuilderContextListener.createMuleContext(MuleXmlBuilderContextListener.java:120)
at
org.mule.config.builders.MuleXmlBuilderContextListener.initialize(MuleXmlBuilderContextListener.java:82)
at
org.mule.config.builders.MuleXmlBuilderContextListener.contextInitialized(MuleXmlBuilderContextListener.java:58)
at
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:539)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at runjettyrun.Bootstrap.main(Bootstrap.java:121)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at
javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:169)
at
org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:135)
... 45 more
[09/12/09 02:50:36:036 CST] INFO broker.BrokerService: ActiveMQ Message
Broker (localhost, null) is shutting down
[09/12/09 02:50:36:036 CST] INFO broker.TransportConnector: Connector
tcp://localhost:9876 Stopped
[09/12/09 02:50:36:036 CST] INFO broker.BrokerService: ActiveMQ JMS Message
Broker (localhost, null) stopped
[09/12/09 02:50:36:036 CST] INFO support.DefaultListableBeanFactory:
Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1f78b68:
defining beans
[customEditorConfigurer,_muleObjectNameProcessor,_mulePropertyPlaceholderProcessor,_muleSimpleRegistryBootstrap,_muleNotificationManager,_muleConfiguration,._muleNotificationManager:notification.1,._muleNotificationManager:notification.2,._muleNotificationManager:notification.3,._muleNotificationManager:notification.4,._muleNotificationManager:notification.5,._muleNotificationManager:notification.6,._muleNotificationManager:notification.7,._muleNotificationManager:notification.8,._muleNotificationManager:notification.9,._muleNotificationManager:notification.10,_muleSystemModel,_muleQueueManager,_muleSecurityManager,_muleProperties,_muleEndpointFactory,_muleStreamCloserService,_defaultThreadingProfile,_defaultMessageDispatcherThreadingProfile,_defaultMessageRequesterThreadingProfile,_defaultMessageReceiverThreadingProfile,_defaultServiceThreadingProfile,_defaultRetryPolicyTemplate,jmsConnector,.:transportConnector,org.apache.activemq.xbean.XBeanBrokerService#0,.:broker];
root of factory hierarchy
[09/12/09 02:50:36:036 CST] INFO broker.BrokerService: ActiveMQ Message
Broker (localhost, ID:LHX002CE931H8C2-4669-1260391836425-0:0) is shutting
down
[09/12/09 02:50:38:038 CST] INFO broker.TransportConnector: Connector
tcp://localhost:9876 Stopped
[09/12/09 02:50:38:038 CST] INFO broker.BrokerService: ActiveMQ JMS Message
Broker (localhost, ID:LHX002CE931H8C2-4669-1260391836425-0:0) stopped
[09/12/09 02:50:38:038 CST] INFO activemq.ActiveMQJmsConnector: Disposing:
ActiveMQJmsConnector{this=61373f, started=false, initialised=true,
name='jmsConnector', disposed=false,
numberOfConcurrentTransactedReceivers=4,
createMultipleTransactedReceivers=true, connected=false,
supportedProtocols=[jms], serviceOverrides=null}
[09/12/09 02:50:38:038 CST] INFO activemq.ActiveMQJmsConnector: Disposed:
ActiveMQJmsConnector{this=61373f, started=false, initialised=false,
name='jmsConnector', disposed=true, numberOfConcurrentTransactedReceivers=4,
createMultipleTransactedReceivers=true, connected=false,
supportedProtocols=[jms], serviceOverrides=null}
[09/12/09 02:50:38:038 CST] ERROR
builders.WebappMuleXmlConfigurationBuilder: Configuration with
"org.mule.config.builders.WebappMuleXmlConfigurationBuilder" failed.
org.mule.api.lifecycle.InitialisationException: Initialisation Failure:
Error creating bean with name '.:broker' defined in
activemq-mule-config.xml: Invocation of init method failed; nested exception
is java.io.IOException: Failed to bind to server socket:
tcp://localhost:9876 due to: java.net.BindException: Address already in use:
JVM_Bind
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:76)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at
org.mule.config.builders.WebappMuleXmlConfigurationBuilder.doConfigure(WebappMuleXmlConfigurationBuilder.java:82)
at
org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
at
org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
at
org.mule.config.builders.MuleXmlBuilderContextListener.createMuleContext(MuleXmlBuilderContextListener.java:120)
at
org.mule.config.builders.MuleXmlBuilderContextListener.initialize(MuleXmlBuilderContextListener.java:82)
at
org.mule.config.builders.MuleXmlBuilderContextListener.contextInitialized(MuleXmlBuilderContextListener.java:58)
at
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:539)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at runjettyrun.Bootstrap.main(Bootstrap.java:121)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '.:broker' defined in activemq-mule-config.xml:
Invocation of init method failed; nested exception is java.io.IOException:
Failed to bind to server socket: tcp://localhost:9876 due to:


java.net.BindException: Address already in use: JVM_Bind

at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at
org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:68)
... 20 more
Caused by: java.io.IOException: Failed to bind to server socket:
tcp://localhost:9876 due to: java.net.BindException: Address already in use:
JVM_Bind
at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
at
org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:139)
at
org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:60)
at
org.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:131)
at
org.apache.activemq.broker.TransportConnector.createTransportServer(TransportConnector.java:304)
at
org.apache.activemq.broker.TransportConnector.getServer(TransportConnector.java:133)
at
org.apache.activemq.broker.TransportConnector.start(TransportConnector.java:193)
at
org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:1961)
at
org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:1911)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:471)
at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 34 more
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at
javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:169)
at
org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:135)
... 45 more
2009-12-09 14:50:38.885:/muleplay:WARN: Initialisation Failure: Error
creating bean with name '.:broker' defined in activemq-mule-config.xml:
Invocation of init method failed; nested exception is java.io.IOException:
Failed to bind to server socket: tcp://localhost:9876 due to:


java.net.BindException: Address already in use: JVM_Bind

(org.mule.api.lifecycle.InitialisationException)
org.mule.api.config.ConfigurationException: Initialisation Failure: Error
creating bean with name '.:broker' defined in activemq-mule-config.xml:
Invocation of init method failed; nested exception is java.io.IOException:
Failed to bind to server socket: tcp://localhost:9876 due to:


java.net.BindException: Address already in use: JVM_Bind

(org.mule.api.lifecycle.InitialisationException)
at
org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at
org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
at
org.mule.config.builders.MuleXmlBuilderContextListener.createMuleContext(MuleXmlBuilderContextListener.java:120)
at
org.mule.config.builders.MuleXmlBuilderContextListener.initialize(MuleXmlBuilderContextListener.java:82)
at
org.mule.config.builders.MuleXmlBuilderContextListener.contextInitialized(MuleXmlBuilderContextListener.java:58)
at
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:539)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at runjettyrun.Bootstrap.main(Bootstrap.java:121)
Caused by: org.mule.api.lifecycle.InitialisationException: Initialisation
Failure: Error creating bean with name '.:broker' defined in
activemq-mule-config.xml: Invocation of init method failed; nested exception
is java.io.IOException: Failed to bind to server socket:
tcp://localhost:9876 due to: java.net.BindException: Address already in use:
JVM_Bind
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:76)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at
org.mule.config.builders.WebappMuleXmlConfigurationBuilder.doConfigure(WebappMuleXmlConfigurationBuilder.java:82)
at
org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
... 16 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '.:broker' defined in activemq-mule-config.xml:
Invocation of init method failed; nested exception is java.io.IOException:
Failed to bind to server socket: tcp://localhost:9876 due to:


java.net.BindException: Address already in use: JVM_Bind

at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at
org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:68)
... 20 more
Caused by: java.io.IOException: Failed to bind to server socket:
tcp://localhost:9876 due to: java.net.BindException: Address already in use:
JVM_Bind
at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
at
org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:139)
at
org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:60)
at
org.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:131)
at
org.apache.activemq.broker.TransportConnector.createTransportServer(TransportConnector.java:304)
at
org.apache.activemq.broker.TransportConnector.getServer(TransportConnector.java:133)
at
org.apache.activemq.broker.TransportConnector.start(TransportConnector.java:193)
at
org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:1961)
at
org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:1911)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:471)
at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 34 more
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at
javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:169)
at
org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:135)
... 45 more
org.mule.api.config.ConfigurationException: Initialisation Failure: Error
creating bean with name '.:broker' defined in activemq-mule-config.xml:
Invocation of init method failed; nested exception is java.io.IOException:
Failed to bind to server socket: tcp://localhost:9876 due to:


java.net.BindException: Address already in use: JVM_Bind

(org.mule.api.lifecycle.InitialisationException)
at
org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at
org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at
org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
at
org.mule.config.builders.MuleXmlBuilderContextListener.createMuleContext(MuleXmlBuilderContextListener.java:120)
at
org.mule.config.builders.MuleXmlBuilderContextListener.initialize(MuleXmlBuilderContextListener.java:82)
at
org.mule.config.builders.MuleXmlBuilderContextListener.contextInitialized(MuleXmlBuilderContextListener.java:58)
at
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:539)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at runjettyrun.Bootstrap.main(Bootstrap.java:121)
Caused by: org.mule.api.lifecycle.InitialisationException: Initialisation
Failure: Error creating bean with name '.:broker' defined in
activemq-mule-config.xml: Invocation of init method failed; nested exception
is java.io.IOException: Failed to bind to server socket:
tcp://localhost:9876 due to: java.net.BindException: Address already in use:
JVM_Bind
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:76)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at
org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at
org.mule.config.builders.WebappMuleXmlConfigurationBuilder.doConfigure(WebappMuleXmlConfigurationBuilder.java:82)
at
org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
... 16 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '.:broker' defined in activemq-mule-config.xml:
Invocation of init method failed; nested exception is java.io.IOException:
Failed to bind to server socket: tcp://localhost:9876 due to:


java.net.BindException: Address already in use: JVM_Bind

at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at
org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:68)
... 20 more
Caused by: java.io.IOException: Failed to bind to server socket:
tcp://localhost:9876 due to: java.net.BindException: Address already in use:
JVM_Bind
at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
at
org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:139)
at
org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:60)
at
org.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:131)
at
org.apache.activemq.broker.TransportConnector.createTransportServer(TransportConnector.java:304)
at
org.apache.activemq.broker.TransportConnector.getServer(TransportConnector.java:133)
at
org.apache.activemq.broker.TransportConnector.start(TransportConnector.java:193)
at
org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:1961)
at
org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:1911)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:471)
at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 34 more
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at
javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:169)
at
org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:135)
... 45 more
2009-12-09 14:50:38.979::INFO: Started SelectChann...@0.0.0.0:8080
--
View this message in context: http://old.nabble.com/ActiveMQ-Spring-namespace-configuration-for-embedded-broker-results-in-port-bind-exception-tp26715377p26717511.html

Richard Swart

unread,
Dec 9, 2009, 5:02:38 PM12/9/09
to us...@mule.codehaus.org
I see no connectionFactory. Can you try:


<spring:beans>
<amq:broker useJmx="false" persistent="false">
<amq:transportConnectors>
<amq:transportConnector uri="tcp://localhost:9876" />
</amq:transportConnectors>
</amq:broker>

<amq:connectionFactory id="amqJmsFactory"
brokerURL="tcp://localhost:9876" />
</spring:beans>

<jms:activemq-connector name="jmsConnector"
brokerURL="tcp://localhost:9876" specification="1.1" connectionFactory-ref=
"amqJmsFactory"/>

Andrew Perepelytsya

unread,
Dec 9, 2009, 5:17:53 PM12/9/09
to us...@mule.codehaus.org

Connection factory will be created implicitly, don't think it changes anything here. It looks like some environmental conflict. I noticed that you are starting it in a jetty webapp, are there any other spring listeners that might be doing duplicate initialisation?

Another guess is that amq's xbean config is not compatible with Mule (just a guess, as they came up with xbeans before spring namespace handlers went mainstream).

Next, check Mule's activemq connector docs, iirc there's a way to reference an external amq broker config (and this is a preferred recommended approach ).

Then, see what happens if you remove xbean config block completely. E.g. it always worked for me when I ran amq broker externally, and brokerURL would just connect to it.

HTH,
Andrew

On Dec 9, 2009 5:02 PM, "Richard Swart" <mule.us...@mulesource.com> wrote:

I see no connectionFactory. Can you try:

<spring:beans> <amq:broker useJmx="false" persistent="false"> <amq:transportConnectors> <amq:trans...

<amq:connectionFactory id="amqJmsFactory"
brokerURL="tcp://localhost:9876" />
</spring:beans>

<jms:activemq-connector name="jmsConnector"

brokerURL="tcp://localhost:9876" specification="1.1" connectionFactory-ref=
"amqJmsFactory"/>

--------------------------------------------------------------------- To unsubscribe from this list...

Richard Swart

unread,
Dec 10, 2009, 4:51:05 AM12/10/09
to us...@mule.codehaus.org
Just did a quick test. I could reproduce the same issue in Mule stand alone. Spring tries to instantiate the broker twice Giving the broker bean an id seems to fix this.

<amq:broker id="myEmbeddedBroker" useJmx="false" persistent="false">

---------------------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages