Problem with setting port on command line
See original GitHub issueAccording to SimpleServerFactory docs:
A startup script can override the port via {@code -Ddw.server.connector.port=$PORT}.
However, when I try:
java -Ddw.server.connector.port=8081 -jar my.jar server config.yml
I get:
config.yml has an error: Failed to parse configuration at: server.connector; Unexpected token (END_OBJECT), expected FIELD_NAME: missing property ‘type’ that is to contain type id (for class io.dropwizard.jetty.ConnectorFactory) at [Source: N/A; line: -1, column: -1](through reference chain: com.acmerocket.stratum.StratumConfiguration[“server”]->io.dropwizard.server.SimpleServerFactory[“connector”])
Without -Ddw.server.connector.port=8081, the app comes up fine.
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Using the PortQry command-line tool - Windows Server
PortQry is a command-line tool that you can use to help troubleshoot TCP/IP connectivity issues. This tool reports the status of target TCP ......
Read more >How to resolve COM Port Issue through Command Line
I require a generalized COMPORT parameter so that the code runs fine on all systems depending on COM PORT involved for that device....
Read more >Using the Command-Line Interface - Oracle Help Center
The command-line interface (CLI) is a text-based way to manage and monitor the system. ... You can use the logical slot/port to configure...
Read more >Changing PostgreSQL port using command line
My PostgreSQL default port is 5432, I want to change default port by using command line (in Windows 7). ... Could someone tell...
Read more >ERROR: Localhost cannot be reached error when port 8080 is ...
Hold down the Windows key and press the R key to open the Run dialog. · Type “cmd” and click OK in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I was able to get it working like this :
java -Ddw.server.applicationConnectors\[0\].type="http" -Ddw.server.applicationConnectors\[0\].port="8080" -jar target/<UR_JAR>.jar server conf.ymlDropwizard Version:
<dropwizard.version>1.3.8</dropwizard.version>The PR #866 does not seem to fix this problem here (tried dropwizard version 1.3.12). I.e. you have to specify a config.yml with at least:
in order to change the port. Otherwise you’ll get: