{"id":8042,"date":"2015-11-22T02:59:53","date_gmt":"2015-11-22T02:59:53","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/22\/change-dropwizard-default-ports-open-source-projects-dropwizard-dropwizard\/"},"modified":"2022-08-30T15:03:03","modified_gmt":"2022-08-30T15:03:03","slug":"change-dropwizard-default-ports-open-source-projects-dropwizard-dropwizard","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/22\/change-dropwizard-default-ports-open-source-projects-dropwizard-dropwizard\/","title":{"rendered":"Change Dropwizard default ports-open source projects dropwizard\/dropwizard"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/49c013245d1ef545ec2b8b7e90f5b12e?s=128&amp;d=identicon&amp;r=PG\" \/> <strong>Ferran Maylinch<\/strong><\/p>\n<p>From the command line, you can set them this way, in Dropwizard 0.6:<\/p>\n<pre><code>java -Ddw.http.port=9090 -Ddw.http.adminPort=9091 -jar yourapp.jar server yourconfig.yml\n<\/code><\/pre>\n<p>If you use Dropwizard 0.7, the system properties are set this way:<\/p>\n<pre><code>java -Ddw.server.applicationConnectors[0].port=9090 -Ddw.server.adminConnectors[0].port=9091 -jar yourapp.jar server yourconfig.yml\n<\/code><\/pre>\n<p>I seems that, if you configure ports through system properties, you also need to set them in the yml (the system property takes precedence, anyway). At least that&#8217;s happening to me in Dropwizard 0.7. Example of the YAML port configuration:<\/p>\n<pre><code>server:\n  applicationConnectors:\n  - type: http\n    port: 8090\n  adminConnectors:\n  - type: http\n    port: 8091\n<\/code><\/pre>\n<p>If you don&#8217;t put those ports in the YAML, Dropwizard complains:<\/p>\n<pre><code>Exception in thread \"main\" java.lang.IllegalArgumentException: Unable to override server.applicationConnectors[0].port; node with index not found.\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ferran Maylinch From the command line, you can set them this way, in Dropwizard 0.6: java -Ddw.http.port=9090 -Ddw.http.adminPort=9091 -jar yourapp.jar server yourconfig.yml If you use Dropwizard 0.7, the system properties are set this way: java -Ddw.server.applicationConnectors[0].port=9090 -Ddw.server.adminConnectors[0].port=9091 -jar yourapp.jar server yourconfig.yml I seems that, if you configure ports through system properties, you also need to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8042","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=8042"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8042\/revisions"}],"predecessor-version":[{"id":8669,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8042\/revisions\/8669"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=8042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=8042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=8042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}