newbie question: mvn clean install fails on BindException

70 views
Skip to first unread message

Darren Strachan

unread,
Oct 1, 2015, 12:48:02 PM10/1/15
to dropwizard-user
Hi folks,

apologies for the newbie question.  I'm trying to get going with the helloWorld sample app.   I've downloaded Dropwizard and unpacked it into C:\Dropwizard\dropwizard.  Gone into the folder and run "mvn clean install".  It skips along fine until it bugs out on this package:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Dropwizard Project ................................. SUCCESS [  4.676 s]
[INFO] Dropwizard Documentation ........................... SUCCESS [  1.139 s]
[INFO] Dropwizard Utility Classes ......................... SUCCESS [ 13.950 s]
[INFO] Dropwizard Jackson Support ......................... SUCCESS [ 11.761 s]
[INFO] Dropwizard Validation Support ...................... SUCCESS [ 13.588 s]
[INFO] Dropwizard Configuration Support ................... SUCCESS [ 19.507 s]
[INFO] Dropwizard Logging Support ......................... SUCCESS [ 18.416 s]
[INFO] Dropwizard Lifecycle Support ....................... SUCCESS [  9.692 s]
[INFO] Dropwizard Metrics Support ......................... SUCCESS [ 11.729 s]
[INFO] Dropwizard Jersey Support .......................... SUCCESS [ 46.927 s]
[INFO] Dropwizard Servlet Support ......................... SUCCESS [ 14.305 s]
[INFO] Dropwizard Jetty Support ........................... SUCCESS [ 24.055 s]
[INFO] Dropwizard ......................................... FAILURE [  7.182 s]
[INFO] Dropwizard Archetypes .............................. SKIPPED
[INFO] Dropwizard Archetype for Simple Java Services ...... SKIPPED

I think this is the "core" package.

on going further up to the actual error I see this:

Running io.dropwizard.server.SimpleServerFactoryTest
127.0.0.1 - - [01/Oct/2015:16:34:38 +0000] "GET /service/test HTTP/1.1" 200 18 "
-" "Java/1.8.0_60" 124
127.0.0.1 - - [01/Oct/2015:16:34:39 +0000] "POST /secret/tasks/hello?name=test_u
ser HTTP/1.1" 200 - "-" "Java/1.8.0_60" 53
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.778 sec - in i
o.dropwizard.server.SimpleServerFactoryTest
Running io.dropwizard.server.DefaultServerFactoryTest
Tests run: 9, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.987 sec <<< FA
ILURE! - in io.dropwizard.server.DefaultServerFactoryTest
testGracefulShutdown(io.dropwizard.server.DefaultServerFactoryTest)  Time elapse
d: 0.331 sec  <<< ERROR!
java.lang.RuntimeException: java.net.BindException: Address already in use: bind

        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:433)
        at sun.nio.ch.Net.bind(Net.java:425)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:
223)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:32
1)
        at org.eclipse.jetty.setuid.SetUIDListener.lifeCycleStarting(SetUIDListe
ner.java:200)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.setStarting(Abstra
ctLifeCycle.java:188)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:67)
        at io.dropwizard.server.DefaultServerFactoryTest.testGracefulShutdown(De
faultServerFactoryTest.java:157)


Results :

Tests in error:
  DefaultServerFactoryTest.testGracefulShutdown:157 » Runtime java.net.BindExcep
...

Tests run: 52, Failures: 0, Errors: 1, Skipped: 0

So I guess this is telling me that one of the ports is already in use, and I should either shut down the app that's using it or else change the ports that Dropwizard is trying to use.     So I tried a couple of things:

1) I went through all the .yml files and changed the ports.  This didn't work.... it failed earlier in the build because it seems like some of the tests Assert on the "standard" ports being used

2) I found out that an app on my machine called FrameworkService.exe is using port 8081.  Unfortunately I can't shut this down because it's the Mcafee update app and is controlled by our System Admins.

I guess my next step will be to try to install Dropwizard on a virtualbox over which i have more control.  But if anyone has any suggestions on how to fix this problem i'd be very grateful 

many thanks
Darren






kaustubh priye

unread,
Oct 2, 2015, 4:10:28 AM10/2/15
to dropwizard-user
In the yaml file of dropwizard you can set application port and admin port, please use some other port in the config.

Darren Strachan

unread,
Oct 2, 2015, 7:44:40 AM10/2/15
to dropwizard-user
hi, thanks for the reply.

when you say the "yaml file of dropwizard", which file is that please?  

when i search for *.yaml files i find these two:

dropwizard\dropwizard-testing\src\test\gzip-vary-test-config.yaml
dropwizard\dropwizard-testing\src\test\test-config.yaml

both of these "port" fields but they are set to zero

there are a whole bunch of *.yml files that do contain port numbers:

Searching for: 808
dropwizard-client\src\test\resources\yaml\bad_auth_password.yml(3): port: 8080
dropwizard-client\src\test\resources\yaml\bad_auth_username.yml(3): port: 8080
dropwizard-client\src\test\resources\yaml\bad_host.yml(3): port: 8080
dropwizard-client\src\test\resources\yaml\bad_scheme.yml(3): port: 8080
dropwizard-client\src\test\resources\yaml\no_auth.yml(3): port: 8080
dropwizard-client\src\test\resources\yaml\no_scheme.yml(3): port: 8080
dropwizard-client\src\test\resources\yaml\proxy.yml(3): port: 8080
dropwizard-configuration\src\test\resources\factory-test-valid.yml(9): - port: 8080
dropwizard-configuration\src\test\resources\factory-test-valid.yml(10): - port: 8081
dropwizard-configuration\src\test\resources\factory-test-valid.yml(11): - port: 8082
dropwizard-configuration\target\test-classes\factory-test-valid.yml(9): - port: 8080
dropwizard-configuration\target\test-classes\factory-test-valid.yml(10): - port: 8081
dropwizard-configuration\target\test-classes\factory-test-valid.yml(11): - port: 8082
dropwizard-example\example.yml(25): #    port: 8080
dropwizard-example\example.yml(32): port: 8080
dropwizard-example\example.yml(46): port: 8081
Found 16 occurrence(s) in 10 file(s)

which of these should i change please?

many thanks in advance for the help!!

Darren

Kaustubh

unread,
Oct 2, 2015, 8:15:36 AM10/2/15
to dropwiz...@googlegroups.com
While starting a dropwizard app we pass command and some params. 
Generally server path-to-config. 

I think in your case the code which you have downloaded must be invoking main class of application with these commands.
Check which file the test is passing to understand where to change. 

PS: Please blame the typos in this mail on auto correct (un)smartness. 

--
You received this message because you are subscribed to a topic in the Google Groups "dropwizard-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dropwizard-user/8BiYbOU22HM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dropwizard-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages