12

I have been trying to find a way to deploy a Dropwizard app on Google AppEngine, but I haven't found anything so far.

Judging by this question (and answer) I think it might not be possible. I would like to be sure about that, and If it does work, I'd like to learn how.

There is a dropwizard fork called warwizard which apparently lets you create war files from your dropwizard code, but it has not been touched for over 6 months, which would likely make it difficult to work with using the dropwizard docs.

Community
  • 1
  • 1
derabbink
  • 2,279
  • 18
  • 46
  • I think this is possible, provided that only those GAE friendly classes are involved. – quarks Mar 15 '13 at 09:31
  • I'm still trying to build warwizard though, and need to verify this, but again, i am not seeing anything that will not make this possible, looking at the code most changes would be on the 'jetty' on the core, and also the db it should be modified for GAE datastore – quarks Mar 15 '13 at 09:38

3 Answers3

11

Dropwizard is just Jersey+Jackson+Jetty bundled together nicely. Jetty and App Engine won't get along (that is, App Engine is already running Jetty, so it doesn't want the application to provide its own).

You're probably best off using Jersey and Jackson without Dropwizard tying them together: http://blog.iparissa.com/googles-app-engine-java/google-app-engine-jax-rs-jersey/ & http://www.cowtowncoder.com/blog/archives/2009/11/entry_338.html

Michael Fairley
  • 12,490
  • 4
  • 23
  • 23
7

You can however, run Dropwizard on Google Compute Engine. Which is basically just linux VMs provided by Google, with access to their APIs if needed.

I manged to get my Dropwizard instance working by doing the following on GCE:

Install Java

sudo apt-get install java7-runtime-headless 

Open firewall ports:

gcutil addfirewall rest --description="http" --allowed="tcp:8080
gcutil addfirewall admin --description="admin" --allowed="tcp:8081"

Copy file to GCE

gcutil --project={project-id} push {instance-name} {local-file} {remote-target-path}

Run your app

java -jar your-app.jar server your-config.yml

EDIT: there is also another alternative called wiztowar https://github.com/twilio/wiztowar which supports DW 0.6.2 only.

yunspace
  • 2,242
  • 17
  • 19
0

I've been trying to solve this issue for the past two month. Here are my findings:

1- Yes, you can deploy Dropwizard as a WAR file. You need to use some hacks like Wizard in a box or WizToWar

2- No! You can't deploy that WAR file on AppEngine standard environment.

Why? The main issue is that AppEngine is using servlet-api v2.5 (which is more than 10 years old!) and has no plan to upgrade to servlet-api v3 or higher. Dropwizard on the other hand require servlet-api v3 or higher.

BUT wait! there is another option

You can deploy Dropwizard on App Engine Flexible Environment

App Engine Flex is still in beta, but I've heard it will be available for public usage in Q1 2017. If you want to use it now, you have to ask for that to be enabled for you.

How do you deploy on App Engine Flex?

-> I've put all the steps on doing that in a blog post here: Deploying Dropwizard on App Engine Flex

Amin Y
  • 661
  • 1
  • 9
  • 15
  • You don't need to ask to use the flex env today, it is available to the public (as a beta version, true). AFAIK you only need to fill a form if you want to use it with a custom domain (from https://cloud.google.com/appengine/docs/flexible/python/upgrading) – Dan Cornilescu Jan 12 '17 at 19:57
  • I've been using the dependency of servlet-api v3.1.0 in my pom for a while now: https://github.com/Leejjon/Blindpool/blob/master/pom.xml So it seems app engine does support up to v3.1.0 – Leejjon Jul 24 '18 at 08:54