dropwizardMigrating to Dropwizard version 0.8.0 was easier than the update from 0.6.x to 0.7.0, but there were still some hang ups, so I thought I would share some of the migration changes need for upgrading to the latest release of from version 0.7.x. The Release notes are a good place to start, but beyond that any hints or guides for upgrading are pretty sparse. This will not be a complete guide and will only cover the specific issues I had to deal with. A working example is availbale at our GitHub project called XDropWizard. XDropWizard is a jump-start web application integrating and demonstrating several useful open source projects such as Yank, Sundial (a Quartz fork), Flot, Bootstrap, AngularJS, HSQLDB, XChart, JUnit, etc., and demonstrates how to serve static content, dynamic content loaded into Freemarker templates, using AJAX and more. The README file has clear instructions on how to build and deploy the app using Maven as well as explanations for how to integrate a plethora of capabilities into a Dropwizard-based web application and web service.

Default service URL

In the case where you want to change the default API base URL to something other than / there is a setting for that. Previously it was set in Java code, and now it’s set in the YML config file. Below is a snippet from XDropWizard.

Before (Version 0.7.x)

After (Version 0.8.0)

ViewBundle

Before version 0.8.0, ViewBundle was a concrete class and you could new-up an instance of it and be done. Now ViewBundle is an abstract class so you need to new it up and implement it’s one abstract method. Below is a snippet from XDropWizard.

Note! As of version 0.8.1 on April 7th, 2015, you can simply new up a ViewBundle class like in 0.7.x.

After commit 943, which is part of the 0.8.1 release, configuring the ViewBundle is straight-forward again:

Wrap Up

Migrating from DropWizard 0.7.x to 0.8.0 can be a bit tricky due to lack of an official migration guide. I hope some of the above examples are helpful to others.

Relevant Links

Related Posts

Subscribe To Our Newsletter

Join our low volume mailing list to receive the latest news and updates from our team.

Leave a Comment

Knowm 32X32 Crossbar

Knowm Newsletter

Are you ready for memristor AI processors? With our newsletter, you will be.