question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with setting port on command line

See original GitHub issue

According 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:closed
  • Created 9 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
swapanshridharcommented, Nov 1, 2019

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.yml

Dropwizard Version:

<dropwizard.version>1.3.8</dropwizard.version>

0reactions
karussellcommented, Jan 28, 2020

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:

server:
  applicationConnectors:
   - type: http

in order to change the port. Otherwise you’ll get:

IllegalArgumentException: Unable to override server.applicationConnectors[0].type; node with index not found
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found