[jboss-jira] [JBoss JIRA] (JGRP-1864) UDP unable to bind to ephemeral port: port out of range:65536

Ion Savin (JIRA) issues at jboss.org
Wed Jul 30 11:36:33 EDT 2014


    [ https://issues.jboss.org/browse/JGRP-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12989190#comment-12989190 ] 

Ion Savin commented on JGRP-1864:
---------------------------------

Hi Bela,

The issue appears on one of the CI machines:
http://ci.infinispan.org/viewLog.html?buildId=10213&tab=buildResultsDiv&buildTypeId=bt9#testNameId-3805633791489505227

added some log message for the exception:
{noformat}
2014-07-30 11:26:28,477 | TRACE | ion(3)-127.0.0.1 | UDP                              | org.apache.log4j.Category         856 | 66 - org.jgroups - 3.5.0.Beta9 | failed to create ephemeral port: 16239 on /fe80:0:0:0:f816:3eff:fe3b:55a9%2
java.net.BindException: Cannot assign requested address
        at java.net.PlainDatagramSocketImpl.bind0(Native Method)[:1.7.0_65]
        at java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:95)[:1.7.0_65]
        at java.net.DatagramSocket.bind(DatagramSocket.java:376)[:1.7.0_65]
        at java.net.DatagramSocket.<init>(DatagramSocket.java:231)[:1.7.0_65]
        at java.net.DatagramSocket.<init>(DatagramSocket.java:284)[:1.7.0_65]
        at org.jgroups.util.DefaultSocketFactory.createDatagramSocket(DefaultSocketFactory.java:62)
        at org.jgroups.protocols.UDP.createEphemeralDatagramSocket(UDP.java:477)
        at org.jgroups.protocols.UDP.createSockets(UDP.java:359)
        at org.jgroups.protocols.UDP.start(UDP.java:264)
        at org.jgroups.stack.ProtocolStack.startStack(ProtocolStack.java:966)
        at org.jgroups.JChannel.startStack(JChannel.java:889)
        at org.jgroups.JChannel._preConnect(JChannel.java:547)
        at org.jgroups.JChannel.connect(JChannel.java:282)
        at org.jgroups.JChannel.connect(JChannel.java:273)
        at org.infinispan.remoting.transport.jgroups.JGroupsTransport.startJGroupsChannelIfNeeded(JGroupsTransport.java:200)
        at org.infinispan.remoting.transport.jgroups.JGroupsTransport.start(JGroupsTransport.java:191)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_65]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_65]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_65]
        at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_65]
        at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168)
        at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:869)
        at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:638)
        at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:627)
        at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:530)
        at org.infinispan.factories.GlobalComponentRegistry.start(GlobalComponentRegistry.java:221)
        at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:563)
        at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:529)
        at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:409)
        at org.infinispan.persistence.jpa.JpaConfigurationTest.testConfigBuilder(JpaConfigurationTest.java:52)
        at org.infinispan.it.osgi.persistence.jpa.JpaConfigurationTest.testConfigBuilder(JpaConfigurationTest.java:27)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_65]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_65]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_65]
        at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_65]
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)[102:org.ops4j.pax.tipi.junit:4.11.0.1]
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:67)
        at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:37)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)[102:org.ops4j.pax.tipi.junit:4.11.0.1]
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)[102:org.ops4j.pax.tipi.junit:4.11.0.1]
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)[102:org.ops4j.pax.tipi.junit:4.11.0.1]
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)[102:org.ops4j.pax.tipi.junit:4.11.0.1]
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)[102:org.ops4j.pax.tipi.junit:4.11.0.1]
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)[102:org.ops4j.pax.tipi.junit:4.11.0.1]
        at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
        at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.invokeViaJUnit(JUnitProbeInvoker.java:124)
        at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.findAndInvoke(JUnitProbeInvoker.java:97)
        at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.call(JUnitProbeInvoker.java:73)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_65]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_65]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_65]
        at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_65]
        at org.ops4j.pax.exam.rbc.internal.RemoteBundleContextImpl.remoteCall(RemoteBundleContextImpl.java:80)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_65]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_65]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_65]
        at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_65]
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)[:1.7.0_65]
        at sun.rmi.transport.Transport$1.run(Transport.java:177)[:1.7.0_65]
        at sun.rmi.transport.Transport$1.run(Transport.java:174)[:1.7.0_65]
        at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_65]
        at sun.rmi.transport.Transport.serviceCall(Transport.java:173)[:1.7.0_65]
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)[:1.7.0_65]
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)[:1.7.0_65]
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)[:1.7.0_65]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_65]
        at java.lang.Thread.run(Thread.java:745)[:1.7.0_65]
{noformat}

the process wasn't running with -Djava.net.preferIPv4Stack=true

> UDP unable to bind to ephemeral port: port out of range:65536
> -------------------------------------------------------------
>
>                 Key: JGRP-1864
>                 URL: https://issues.jboss.org/browse/JGRP-1864
>             Project: JGroups
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.4.4
>            Reporter: Dan Berindei
>            Assignee: Bela Ban
>            Priority: Minor
>             Fix For: 3.4.5, 3.5
>
>
> It looks like {{UDP.createEphemeralDatagramSocket()}} swallows any errors it gets while creating the socket, and throws this exception after trying to bind to all ports in the 0 - 65535 range:
> {noformat}
> java.lang.IllegalArgumentException: port out of range:65536
>     at java.net.InetSocketAddress.checkPort(InetSocketAddress.java:143)
>     at java.net.InetSocketAddress.<init>(InetSocketAddress.java:185)
>     at java.net.DatagramSocket.<init>(DatagramSocket.java:284)
>     at org.jgroups.util.DefaultSocketFactory.createDatagramSocket(DefaultSocketFactory.java:62)
>     at org.jgroups.protocols.UDP.createEphemeralDatagramSocket(UDP.java:429)
>     at org.jgroups.protocols.UDP.createSockets(UDP.java:311)
>     at org.jgroups.protocols.UDP.start(UDP.java:216)
>     at org.jgroups.stack.ProtocolStack.startStack(ProtocolStack.java:966)
>     at org.jgroups.JChannel.startStack(JChannel.java:889)
>     at org.jgroups.JChannel._preConnect(JChannel.java:547)
>     at org.jgroups.JChannel.connect(JChannel.java:282)
>     at org.jgroups.JChannel.connect(JChannel.java:273)
>     at org.infinispan.remoting.transport.jgroups.JGroupsTransport.startJGroupsChannelIfNeeded(JGroupsTransport.java:200)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the jboss-jira mailing list