Dropwizard 0.8 and Jetty fail return 404 on resources

Sim­ple hello world drop­wiz­ard appli­ca­tion throws the error below–


HTTP ERROR 404

Prob­lem access­ing /hello-world. Reason:

Not Found

While app logs says — return 200 for that request.

Rea­son:

If you look closely in ter­mi­nal, it says

"MutableServletContextHandler@4b2a30d{/application,null,AVAILABLE}"

so try /application/hello-world, It will work.

Why is it so:

Answer is in your configuration.yaml file.

If you just define the http port


server:
type: simple
connector:
type: http
port: 8080

Then drop­wiz­ard cre­ates 2 end points for you

appli­ca­tion port : /application/hello-world
admin port : /admin/hello-world

So if you define the sep­a­rate admin port then you do not have to add /application in your end point url.


server:
type: simple
connector:
type: http
port: 8080
type: admin
port: 8081