java.net.BindException: Address already in use

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

java.net.BindException: Address already in use

kiranreddykasa
Hi
 When performing load testing on the following route some of the requests are failing with this exception

 Route :
from("cxf:bean:orderEndpoint").bean(CXFRequestProcessor.class)
.to("netty:tcp://10.44.71.101:7001textline=true").to("netty:tcp://10.44.71.67:7004textline=true")
.bean(MainDummyProcessor.class)
.to("netty:tcp://10.44.71.60:7002?textline=true").to("netty:tcp://10.44.71.67:7004?textline=true")
.bean(MainDummyProcessor.class)
.to("netty:tcp://10.44.71.149:7003?textline=true").to("netty:tcp://10.44.71.67:7004?textline=true")
.bean(MainDummyProcessor.class).transform().constant("OK");


Exception :

ERROR 03 Jul 2013 15:35:54,620 org.apache.camel.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-fsschnd12298-2276-1372845916285-0-47388 on ExchangeId: ID-fsschnd12298-2276-1372845916285-0-46721). Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelException: Cannot connect to 10.44.71.149:7003
org.apache.camel.CamelException: Cannot connect to 10.44.71.149:7003
        at org.apache.camel.component.netty.NettyProducer.openChannel(NettyProducer.java:404)
        at org.apache.camel.component.netty.NettyProducer$NettyProducerPoolableObjectFactory.makeObject(NettyProducer.java:472)
        at org.apache.camel.component.netty.NettyProducer$NettyProducerPoolableObjectFactory.makeObject(NettyProducer.java:467)
        at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188)
        at org.apache.camel.component.netty.NettyProducer.process(NettyProducer.java:215)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)
        at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:335)
        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
        at org.apache.camel.processor.Pipeline.access$100(Pipeline.java:43)
        at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:135)
        at org.apache.camel.processor.RouteContextProcessor$1.done(RouteContextProcessor.java:56)
        at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:347)
        at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
        at org.apache.camel.impl.ProducerCache$1.done(ProducerCache.java:321)
        at org.apache.camel.processor.SendProcessor$2$1.done(SendProcessor.java:127)
        at org.apache.camel.component.netty.NettyProducer$NettyProducerCallback.done(NettyProducer.java:459)
        at org.apache.camel.component.netty.handlers.ClientChannelHandler.messageReceived(ClientChannelHandler.java:173)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:558)
        at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:786)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
        at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:558)
        at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:786)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:458)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:439)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:558)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:553)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:84)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:471)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:332)
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)
        at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102)
        at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.BindException: Address already in use: no further information
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574)
        at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.connect(NioClientSocketPipelineSink.java:496)
        at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processSelectedKeys(NioClientSocketPipelineSink.java:452)
        at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:365)
        ... 3 more


camel version : 2.10.5
I guess my machine is running out of local ports ?
Regards

kiran Reddy
Reply | Threaded
Open this post in threaded view
|

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

ayache.k
Hi

Looks like you're running multiple test on parallel and each test is creating CFX endpoint. As a quick solution try to set port numbers dynamically.

Ayache
Reply | Threaded
Open this post in threaded view
|

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

kiranreddykasa
Hi

I m running only one test instance.

Anyway i got exception while processing request, i.e while sending to external tcp host .
Regards

kiran Reddy
Reply | Threaded
Open this post in threaded view
|

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

ceposta
In reply to this post by kiranreddykasa
Sounds like whatever you're trying to connect to isn't available here:
10.44.71.149:7003




On Wed, Jul 3, 2013 at 6:10 AM, kiranreddykasa <[hidden email]>wrote:

> Hi
>  When performing load testing on the following route some of the requests
> are failing with this exception
>
>  Route :
> from("cxf:bean:orderEndpoint").bean(CXFRequestProcessor.class)
> .to("netty:tcp://10.44.71.101:7001
> textline=true").to("netty:tcp://10.44.71.67:7004textline=true")
> .bean(MainDummyProcessor.class)
> .to("netty:tcp://10.44.71.60:7002?textline=true").to("netty:tcp://
> 10.44.71.67:7004?textline=true")
> .bean(MainDummyProcessor.class)
> .to("netty:tcp://10.44.71.149:7003?textline=true").to("netty:tcp://
> 10.44.71.67:7004?textline=true")
> .bean(MainDummyProcessor.class).transform().constant("OK");
>
>
> Exception :
>
> ERROR 03 Jul 2013 15:35:54,620
> org.apache.camel.processor.DefaultErrorHandler - Failed delivery for
> (MessageId: ID-fsschnd12298-2276-1372845916285-0-47388 on ExchangeId:
> ID-fsschnd12298-2276-1372845916285-0-46721). Exhausted after delivery
> attempt: 1 caught: org.apache.camel.CamelException: Cannot connect to
> 10.44.71.149:7003
> org.apache.camel.CamelException: Cannot connect to 10.44.71.149:7003
>         at
>
> org.apache.camel.component.netty.NettyProducer.openChannel(NettyProducer.java:404)
>         at
>
> org.apache.camel.component.netty.NettyProducer$NettyProducerPoolableObjectFactory.makeObject(NettyProducer.java:472)
>         at
>
> org.apache.camel.component.netty.NettyProducer$NettyProducerPoolableObjectFactory.makeObject(NettyProducer.java:467)
>         at
>
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188)
>         at
>
> org.apache.camel.component.netty.NettyProducer.process(NettyProducer.java:215)
>         at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
>
> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)
>         at
>
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)
>         at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)
>         at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
>
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
>
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
>
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
>
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
>
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
>
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
>         at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
>
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:335)
>         at
>
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
>         at
>
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
>
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
>
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)
>         at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
>         at org.apache.camel.processor.Pipeline.access$100(Pipeline.java:43)
>         at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:135)
>         at
>
> org.apache.camel.processor.RouteContextProcessor$1.done(RouteContextProcessor.java:56)
>         at
>
> org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:347)
>         at
>
> org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
>         at
> org.apache.camel.impl.ProducerCache$1.done(ProducerCache.java:321)
>         at
> org.apache.camel.processor.SendProcessor$2$1.done(SendProcessor.java:127)
>         at
>
> org.apache.camel.component.netty.NettyProducer$NettyProducerCallback.done(NettyProducer.java:459)
>         at
>
> org.apache.camel.component.netty.handlers.ClientChannelHandler.messageReceived(ClientChannelHandler.java:173)
>         at
>
> org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
>         at
>
> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:558)
>         at
>
> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:786)
>         at
> org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
>         at
>
> org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70)
>         at
>
> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:558)
>         at
>
> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:786)
>         at
> org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
>         at
>
> org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:458)
>         at
>
> org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:439)
>         at
>
> org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
>         at
>
> org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
>         at
>
> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:558)
>         at
>
> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:553)
>         at
> org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
>         at
> org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
>         at
> org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:84)
>         at
>
> org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:471)
>         at
>
> org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:332)
>         at
> org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)
>         at
>
> org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102)
>         at
>
> org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: java.net.BindException: Address already in use: no further
> information
>         at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
>         at
> sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574)
>         at
>
> org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.connect(NioClientSocketPipelineSink.java:496)
>         at
>
> org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processSelectedKeys(NioClientSocketPipelineSink.java:452)
>         at
>
> org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:365)
>         ... 3 more
>
>
> camel version : 2.10.5
> I guess my machine is running out of local ports ?
>
>
>
> -----
> Regards
>
> kiran Reddy
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/java-net-BindException-Address-already-in-use-tp5735132.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta
Reply | Threaded
Open this post in threaded view
|

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

kiranreddykasa
cxfloadtest.csv

It is available ,because very few transactions (1 %) are failing .

Please find the load test details in the attached file.
Regards

kiran Reddy
Reply | Threaded
Open this post in threaded view
|

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

kiranreddykasa

By error handler solved the above issue,

 onException(BindException.class).handled(true).maximumRedeliveries(3).redeliveryDelay(1000).asyncDelayedRedelivery();

But not sure why it's causing though.
Regards

kiran Reddy