You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by bocamel <jo...@gmail.com> on 2018/07/31 14:57:34 UTC

Sporadic "Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address already in use: connect"

My Camel/ActiveMQ application (using SpringBoot) has worked well for many
months but suddenly we started to get the said error once in a while. 
Upgrading from 5.14.2 to 5.15.4 did not help.  The traffic is not heavy at
all (less than 10 messages per minute).  The application passes messages to
another process (exchangePattern=INOUT, with requestTimeout=35000). 
Here is the stacktrace, followed by activemq config and the camel route.  
Look at the Windows processes, nothing else uses port 61616 except the
activeMQ broker.  Any help will be greatly appreciated.

 Stacktrace: org.springframework.jms.UncategorizedJmsException:
Uncategorized exception occurred during JMS processing; nested exception is
javax.jms.JMSException: Error while attempting to add new Connection to the
pool; nested exception is javax.jms.JMSException: Could not connect to
broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address
already in use: connect
	at
org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)
	at
org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:487)
	at
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:433)
	at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:409)
	at
org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:239)
	at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:150)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	at
org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.asyncInvoke(CxfRsInvoker.java:95)
	at
org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.performInvocation(CxfRsInvoker.java:69)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
	at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:262)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:234)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:76)
	at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
	at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1239)
	at
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:170)
	at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1141)
	at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
	at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:118)
	at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:564)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
	at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
	at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
	at
org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:258)
	at
org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:147)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at
org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:122)
	at
org.eclipse.jetty.util.thread.strategy.ExecutingExecutionStrategy.invoke(ExecutingExecutionStrategy.java:58)
	at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:201)
	at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:133)
	at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
	at
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
	at java.lang.Thread.run(Thread.java:745)
Caused by: javax.jms.JMSException: Error while attempting to add new
Connection to the pool
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createJmsException(PooledConnectionFactory.java:266)
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:225)
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:204)
	at
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
	... 49 more
Caused by: javax.jms.JMSException: Could not connect to broker URL:
tcp://localhost:61616. Reason: java.net.BindException: Address already in
use: connect
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36)
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:374)
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:304)
	at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:244)
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:275)
	at
org.apache.activemq.jms.pool.PooledConnectionFactory$1.makeObject(PooledConnectionFactory.java:95)
	at
org.apache.activemq.jms.pool.PooledConnectionFactory$1.makeObject(PooledConnectionFactory.java:92)
	at
org.apache.commons.pool2.impl.GenericKeyedObjectPool.create(GenericKeyedObjectPool.java:1041)
	at
org.apache.commons.pool2.impl.GenericKeyedObjectPool.addObject(GenericKeyedObjectPool.java:1221)
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:221)
	... 52 more
Caused by: java.net.BindException: Address already in use: connect
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at
java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
	at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at
org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:525)
	at
org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:488)
	at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55)
	at
org.apache.activemq.transport.AbstractInactivityMonitor.start(AbstractInactivityMonitor.java:169)
	at
org.apache.activemq.transport.InactivityMonitor.start(InactivityMonitor.java:52)
	at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64)
	at
org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
	at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64)
	at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64)
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:354)
	... 60 more


ActiveMQ config:

    <bean id="pooledConnectionFactory"
          class="org.apache.activemq.pool.PooledConnectionFactory"
init-method="start" destroy-method="stop">
        <property name="maxConnections" value="25" /> 
	<property name="connectionFactory">
            <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                <property name="brokerURL" value="tcp://localhost:61616" />
            </bean>
        </property>
		
    </bean>

    <bean id="jmsConfig"
          class="org.apache.camel.component.jms.JmsConfiguration">
        <property name="connectionFactory" ref="pooledConnectionFactory"/>
        <property name="concurrentConsumers" value="10"/>
    </bean>

    <bean id="activemq"
          class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="configuration" ref="jmsConfig"/>
    </bean>


Call to the activeMQ endpoint (using Camel and queue name set in Camel
header CamelJmsDestinationName):

.to('activemq:queue:dummy?exchangePattern=InOut&requestTimeout=35000')




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Sporadic "Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address already in use: connect"

Posted by cooshal <ku...@gmail.com>.
Hi:

I just tried netstat, and I see majority of the connections as "TIME_WAIT".
And, there are a lot of connections. 

Thank you for the pointers. I will dig further and post back later.

Regards,
Cooshal.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Sporadic "Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address already in use: connect"

Posted by cooshal <ku...@gmail.com>.
Hi again:

I looked futher into this issue.

It is strange that, something seems to be wrong with my camel route bundles.
Initially, I was not able to replicate this issue on a different system.
Then, I used my camel routes bundle that was built 2 weeks ago. And, now I
see plenty of connections. I have not made any significant changes in the
bundles or the routes since then. It was the service reference availability
that I had changed from optional to mandatory. But that doesn't seem to have
an effect on this behaviour.

And now, with my newly built bundles, I have two different connections (as
seen in the activemq console)

Name  	Remote Address  	Active  	Slow  
ID:MDK-10884-1559899975517-0:2	tcp://127.0.0.1:10942	true	false
ID:MDK-10884-1559899975517-2:8	tcp://127.0.0.1:12448	true	false

And inside ID:MDK-10884-1559899975517-2:8, I see all my consumers there.
And, few consumers have multiple sessions as well. I believe this is
expected and optimal, right?

It's good that I see a lot less connections, but now my confusion is, "why
does it work?" .




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Sporadic "Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address already in use: connect"

Posted by Tim Bain <tb...@alumni.duke.edu>.
This sounds to me like a misbehaving connection pool. Maybe jax-jms has a
bug?

I'd try to get a count of open and recently-closed sockets on the client
host (e.g. via netstat) to try to confirm that. If you see tens of
thousands, you'll want to try to dig into why they're being closed and
re-opened rather than just reused.

Tim

On Mon, Jun 3, 2019, 1:55 AM cooshal <ku...@gmail.com> wrote:

> Hi again:
>
> has anyone encountered and resolved similar issue ?
>
> My activemq configuration has the default stuffs. Should I configure
> something there as well?
>
> After I update my pax-jms configuration by adding pool=transx, I get
> following log events:
>
> INFO  Updating configuration from org.ops4j.connectionfactory-consumer.cfg
> 09:48:10.597 INFO [CM Configuration Updater (Update:
> pid=org.ops4j.connectionfactory.34183829-76f2-4bf7-8209-c265780d57b9)] Lost
> service dependency:
>
> (&(objectClass=org.ops4j.pax.jms.service.ConnectionFactoryFactory)(type=activemq))
> 09:48:10.611 INFO [CM Configuration Updater (Update:
> pid=org.ops4j.connectionfactory.34183829-76f2-4bf7-8209-c265780d57b9)]
> Waiting for service dependency:
>
> (&(objectClass=org.ops4j.pax.jms.service.PooledConnectionFactoryFactory)(pool=transx)(xa=false))
>
> It would be great if somebody could point me to some direction in resolving
> this issue.
>
> Regards,
> Cooshal.
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: Sporadic "Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address already in use: connect"

Posted by cooshal <ku...@gmail.com>.
Hi again:

has anyone encountered and resolved similar issue ?

My activemq configuration has the default stuffs. Should I configure
something there as well?

After I update my pax-jms configuration by adding pool=transx, I get
following log events:

INFO  Updating configuration from org.ops4j.connectionfactory-consumer.cfg
09:48:10.597 INFO [CM Configuration Updater (Update:
pid=org.ops4j.connectionfactory.34183829-76f2-4bf7-8209-c265780d57b9)] Lost
service dependency:
(&(objectClass=org.ops4j.pax.jms.service.ConnectionFactoryFactory)(type=activemq))
09:48:10.611 INFO [CM Configuration Updater (Update:
pid=org.ops4j.connectionfactory.34183829-76f2-4bf7-8209-c265780d57b9)]
Waiting for service dependency:
(&(objectClass=org.ops4j.pax.jms.service.PooledConnectionFactoryFactory)(pool=transx)(xa=false))

It would be great if somebody could point me to some direction in resolving
this issue.

Regards,
Cooshal.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Sporadic "Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address already in use: connect"

Posted by cooshal <ku...@gmail.com>.
Hi JB:

Thank you for your reply.

how do I start an embedded server in the bundle? I do not recall doing
anything like that. Following lines are in my jms config file:

name=db-consumer 
jms.url=tcp://localhost:61616 
jms.username=<user>
jms.password=<password>
type=activemq 
osgi.jndi.service.name=jms/consumer

and the following are the dependencies I am using in my feature for this
bundle:

<feature>jms</feature>
<feature>transaction</feature>
<feature>spring</feature>
<feature>pax-jms-config</feature>
<feature>pax-jms-activemq</feature>
<bundle
dependency="true">mvn:org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/1.0.1</bundle>
<bundle
dependency="true">mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1</bundle>
<bundle
dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aopalliance/1.0_6</bundle>
<bundle>mvn:org.apache.activemq/activemq-osgi/${activeMQ.version}</bundle>

Did I do something wrong here ?

Regards,
Cooshal.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Sporadic "Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address already in use: connect"

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Don't you start an embedded server in your bundle ?

I guess you are using a poolable connection factory.

Regards
JB

Le 28 mai 2019 à 13:27, à 13:27, cooshal <ku...@gmail.com> a écrit:
>Hi:
>
>I am going through similar issues right now.
>
>ActiveMQ version: 5.15.4
>Environment: Windows
>Karaf Version: 4.2.0
>
>I am using ActiveMQ and Apache Karaf with camel and pax-jms. Multiple
>karaf
>instances are using this one broker instance. My Karaf instances are
>installed as a service, and so is ActiveMQ as well.
>
>This is how my config looks like:
>
>name=db-consumer
>jms.url=tcp://localhost:61616
>jms.username=<user>
>jms.password=<password>
>type=activemq
>osgi.jndi.service.name=jms/consumer
>
>Time and again, with high frequency of data, I am getting the following
>error:
>
>Uncategorized exception occurred during JMS processing; nested
>exception is
>javax.jms.JMSException: Could not connect to broker URL:
>tcp://localhost:61616. Reason: java.net.BindException: Address already
>in
>use: connect
>
>Do I need to configure something specific in the broker or in the
>configuration to resolve this issue?
>
>Regards,
>Cooshal.
>
>
>
>
>--
>Sent from:
>http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Sporadic "Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address already in use: connect"

Posted by cooshal <ku...@gmail.com>.
Hi:

I am going through similar issues right now.

ActiveMQ version: 5.15.4
Environment: Windows
Karaf Version: 4.2.0

I am using ActiveMQ and Apache Karaf with camel and pax-jms. Multiple karaf
instances are using this one broker instance. My Karaf instances are
installed as a service, and so is ActiveMQ as well.

This is how my config looks like:

name=db-consumer
jms.url=tcp://localhost:61616
jms.username=<user>
jms.password=<password>
type=activemq
osgi.jndi.service.name=jms/consumer

Time and again, with high frequency of data, I am getting the following
error:

Uncategorized exception occurred during JMS processing; nested exception is
javax.jms.JMSException: Could not connect to broker URL:
tcp://localhost:61616. Reason: java.net.BindException: Address already in
use: connect

Do I need to configure something specific in the broker or in the
configuration to resolve this issue?

Regards,
Cooshal.




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Sporadic "Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address already in use: connect"

Posted by Tim Bain <tb...@alumni.duke.edu>.
This means that you're trying to create more outbound sockets in a short
time than your host allows. See
https://stackoverflow.com/questions/4708649/java-net-bindexception-address-already-in-use-when-trying-to-do-rapid-socket
for a more detailed explanation.

This could happen if you have an unreasonably large connection pool, but
yours is only set to 25 so that's not it. It could also happen if your
process restarted many times in a row in quick succession, consuming 25
sockets at a time. Is it possible that that's what happened?

Tim

On Tue, Jul 31, 2018, 9:23 AM bocamel <jo...@gmail.com> wrote:

> My Camel/ActiveMQ application (using SpringBoot) has worked well for many
> months but suddenly we started to get the said error once in a while.
> Upgrading from 5.14.2 to 5.15.4 did not help.  The traffic is not heavy at
> all (less than 10 messages per minute).  The application passes messages to
> another process (exchangePattern=INOUT, with requestTimeout=35000).
> Here is the stacktrace, followed by activemq config and the camel route.
> Look at the Windows processes, nothing else uses port 61616 except the
> activeMQ broker.  Any help will be greatly appreciated.
>
>  Stacktrace: org.springframework.jms.UncategorizedJmsException:
> Uncategorized exception occurred during JMS processing; nested exception is
> javax.jms.JMSException: Error while attempting to add new Connection to the
> pool; nested exception is javax.jms.JMSException: Could not connect to
> broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address
> already in use: connect
>         at
>
> org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)
>         at
>
> org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)
>         at
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:487)
>         at
>
> org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:433)
>         at
> org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:409)
>         at
>
> org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:239)
>         at
> org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:150)
>         at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
>         at
>
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
>         at
>
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
>         at
>
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
>         at
>
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
>         at
>
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
>         at
>
> org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.asyncInvoke(CxfRsInvoker.java:95)
>         at
>
> org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.performInvocation(CxfRsInvoker.java:69)
>         at
>
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
>         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)
>         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
>         at
>
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
>         at
>
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
>         at
>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>         at
>
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>         at
>
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:262)
>         at
>
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:234)
>         at
>
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:76)
>         at
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
>         at
>
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
>         at
>
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1239)
>         at
>
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:170)
>         at
>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1141)
>         at
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>         at
>
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
>         at
>
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:118)
>         at
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
>         at org.eclipse.jetty.server.Server.handle(Server.java:564)
>         at
> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
>         at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
>         at
> org.eclipse.jetty.io
> .AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
>         at org.eclipse.jetty.io
> .FillInterest.fillable(FillInterest.java:110)
>         at
> org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:258)
>         at
> org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:147)
>         at org.eclipse.jetty.io
> .FillInterest.fillable(FillInterest.java:110)
>         at org.eclipse.jetty.io
> .ChannelEndPoint$2.run(ChannelEndPoint.java:124)
>         at
> org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:122)
>         at
>
> org.eclipse.jetty.util.thread.strategy.ExecutingExecutionStrategy.invoke(ExecutingExecutionStrategy.java:58)
>         at
>
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:201)
>         at
>
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:133)
>         at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
>         at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: javax.jms.JMSException: Error while attempting to add new
> Connection to the pool
>         at
>
> org.apache.activemq.jms.pool.PooledConnectionFactory.createJmsException(PooledConnectionFactory.java:266)
>         at
>
> org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:225)
>         at
>
> org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:204)
>         at
>
> org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)
>         at
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
>         ... 49 more
> Caused by: javax.jms.JMSException: Could not connect to broker URL:
> tcp://localhost:61616. Reason: java.net.BindException: Address already in
> use: connect
>         at
>
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36)
>         at
>
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:374)
>         at
>
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:304)
>         at
>
> org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:244)
>         at
>
> org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:275)
>         at
>
> org.apache.activemq.jms.pool.PooledConnectionFactory$1.makeObject(PooledConnectionFactory.java:95)
>         at
>
> org.apache.activemq.jms.pool.PooledConnectionFactory$1.makeObject(PooledConnectionFactory.java:92)
>         at
>
> org.apache.commons.pool2.impl.GenericKeyedObjectPool.create(GenericKeyedObjectPool.java:1041)
>         at
>
> org.apache.commons.pool2.impl.GenericKeyedObjectPool.addObject(GenericKeyedObjectPool.java:1221)
>         at
>
> org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:221)
>         ... 52 more
> Caused by: java.net.BindException: Address already in use: connect
>         at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
>         at
> java.net
> .DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
>         at
> java.net
> .AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
>         at
> java.net
> .AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
>         at
> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
>         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
>         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
>         at java.net.Socket.connect(Socket.java:589)
>         at
>
> org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:525)
>         at
>
> org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:488)
>         at
> org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55)
>         at
>
> org.apache.activemq.transport.AbstractInactivityMonitor.start(AbstractInactivityMonitor.java:169)
>         at
>
> org.apache.activemq.transport.InactivityMonitor.start(InactivityMonitor.java:52)
>         at
>
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64)
>         at
>
> org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
>         at
>
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64)
>         at
>
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64)
>         at
>
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:354)
>         ... 60 more
>
>
> ActiveMQ config:
>
>     <bean id="pooledConnectionFactory"
>           class="org.apache.activemq.pool.PooledConnectionFactory"
> init-method="start" destroy-method="stop">
>         <property name="maxConnections" value="25" />
>         <property name="connectionFactory">
>             <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>                 <property name="brokerURL" value="tcp://localhost:61616" />
>             </bean>
>         </property>
>
>     </bean>
>
>     <bean id="jmsConfig"
>           class="org.apache.camel.component.jms.JmsConfiguration">
>         <property name="connectionFactory" ref="pooledConnectionFactory"/>
>         <property name="concurrentConsumers" value="10"/>
>     </bean>
>
>     <bean id="activemq"
>           class="org.apache.activemq.camel.component.ActiveMQComponent">
>         <property name="configuration" ref="jmsConfig"/>
>     </bean>
>
>
> Call to the activeMQ endpoint (using Camel and queue name set in Camel
> header CamelJmsDestinationName):
>
> .to('activemq:queue:dummy?exchangePattern=InOut&requestTimeout=35000')
>
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>