Default http/admin port in dropwizard project

Posted by mithrandir on Stack Overflow See other posts from Stack Overflow or by mithrandir
Published on 2014-08-20T03:52:38Z Indexed on 2014/08/20 4:22 UTC
Read the original article Hit count: 109

Filed under:
|

I have a dropwizard project and I have maintained a config.yml file at the ROOT of the project (basically at the same level as pom.xml). Here I have specified the HTTP port to be used as follows:

http:
    port:9090
    adminPort:9091

I have the following code in my TestService.java file

public class TestService extends Service<TestConfiguration> {

    @Override
    public void initialize(Bootstrap<TestConfiguration> bootstrap) {
        bootstrap.setName("test");
    }

    @Override
    public void run(TestConfiguration config, Environment env) throws Exception {
        // initialize some resources here..
    }

    public static void main(String[] args) throws Exception {
        new TestService().run(new String[] { "server" });
    }

}

I expect the config.yml file to be used to determine the HTTP port. However the app always seems to start with the default ports 8080 and 8081. Also note that I am running this from eclipse.

Any insights as to what am I doing wrong here ?

© Stack Overflow or respective owner

Related posts about port

Related posts about dropwizard