Dropwizard in tomcat container

2019-02-18 20:51发布

问题:

I have an existing app, that runs in tomcat. Now I am evaluating dropwizard for my new rest webservices. Now, dropwizard comes with inbuilt jetty. How do I deploy it with my tomcat container and not with its jetty container?

回答1:

You can't do this. Dropwizard embeds Jetty. You should look into just using Jersey as a standard web application.



回答2:

It makes a lot of sense to roll out your application as a jar, but sometimes you are bounded by company/enterprise standards and you're obliged to deploy on a given application server in production. 'Dropwizard in a box' ( https://github.com/rvs-fluid-it/wizard-in-a-box) makes it trivial to deploy a Dropwizard application as a war. It swaps DropWizard's embedded Jetty container and bridges to a servlet 3 container. 'Dropwizard in a box' is tested on Tomcat 7 and Weblogic 12c.