Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.net.BindException: No free port within range #116

Closed
yegor256 opened this issue Dec 9, 2015 · 2 comments · Fixed by #208
Closed

java.net.BindException: No free port within range #116

yegor256 opened this issue Dec 9, 2015 · 2 comments · Fixed by #208

Comments

@yegor256
Copy link
Member

yegor256 commented Dec 9, 2015

Sometimes we don't have enough ports:

returnsErrorIfNoMatches(com.jcabi.http.mock.MkContainerTest)  Time elapsed: 2.494 sec  <<< ERROR!
java.lang.Exception: Unexpected exception, expected<java.util.NoSuchElementException> but was<java.net.BindException>
    at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:28)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.BindException: No free port within range: 39318=com.sun.grizzly.http.SelectorThreadHandler@4c469ca0
    at com.sun.grizzly.TCPSelectorHandler.initSelector(TCPSelectorHandler.java:432)
    at com.sun.grizzly.TCPSelectorHandler.preSelect(TCPSelectorHandler.java:378)
    at com.sun.grizzly.SelectorHandlerRunner.doSelect(SelectorHandlerRunner.java:188)
    at com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:132)
    ... 3 more

We should not crash in that case, but wait a few seconds and try again.

@dmarkov
Copy link

dmarkov commented Dec 9, 2015

@yegor256 I just added bug tag here

@dmarkov dmarkov added the bug label Dec 9, 2015
@dmarkov
Copy link

dmarkov commented Dec 10, 2015

@yegor256 thanks for the report, I topped your acc for 15 mins, payment ID 000-0725edcf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants