title: Cant run a DropWizard server side properly
body: <p>I am developing a android and iOS app that needs to have a RESTful server side.
  Until today i used Jersey with RunJettyRun on eclipse but i decided to start using something new and better! and i moved to DropWizard and IntelliJ IDEA</p>
  
  <p>These are the softwares i got installed and things i took care of already :
  - Java 8
  - Maven 3.1.1
  - Environment variables for Maven and for Java.</p>
  
  <p>Well for now what i did is following the tutorial of Getting Started of DropWizard on their website.
  I did exactly as they said and at the end i tried to run the jar i got from the mvn package command in the IntelliJ Terminal. The result was in the output:</p>
  
  <pre><code>usage: java -jar dropwizard-1.0-SNAPSHOT.jar
         [-h] [-v] {server,check} ...
  
  positional arguments:
    {server,check}         available commands
  
  optional arguments:
    -h, --help             show this help message and exit
    -v, --version          show the application version and exit
  
  Process finished with exit code 0
  </code></pre>
  
  <p>The code : </p>
  
  <p>Resource Class:</p>
  
  <pre><code>@Path("/hello-world")
  @Produces(MediaType.APPLICATION_JSON)
  public class HelloResource {
      private final String template;
      private final String defaultName;
      private final AtomicLong counter;
  
      public HelloResource(String template, String defaultName) {
          this.template = template;
          this.defaultName = defaultName;
          this.counter = new AtomicLong();
      }
  
      @GET
      @Timed
      public Saying sayHello(@QueryParam("name") Optional&lt;String&gt; name) {
          final String value = String.format(template, name.or(defaultName));
          return new Saying(counter.incrementAndGet(), value);
      }
  }
  </code></pre>
  
  <p>Configuration Class:
      import com.fasterxml.jackson.annotation.JsonProperty;
      import io.dropwizard.Configuration;
      import org.hibernate.validator.constraints.NotEmpty;</p>
  
  <pre><code>import javax.validation.Valid;
  
  /**
   * Created by Ido on 2/25/2015.
   */
  public class Conf extends Configuration {
      @NotEmpty
      private String template;
  
      @NotEmpty
      private String defaultName = "Stranger";
  
      @JsonProperty
      public String getTemplate() {
          return template;
      }
  
      @JsonProperty
      public void setTemplate(String template) {
          this.template = template;
      }
  
      @JsonProperty
      public String getDefaultName() {
          return defaultName;
      }
  
      @JsonProperty
      public void setDefaultName(String name) {
          this.defaultName = name;
      }
  }
  </code></pre>
  
  <p>Representation Class:
      public class Saying {
          private long id;</p>
  
  <pre><code>    @Length(max = 3)
      private String content;
  
      public Saying() {
          // Jackson deserialization
      }
  
      public Saying(long id, String content) {
          this.id = id;
          this.content = content;
      }
  
      @JsonProperty
      public long getId() {
          return id;
      }
  
      @JsonProperty
      public String getContent() {
          return content;
      }
  }
  </code></pre>
  
  <p>Service Class:</p>
  
  <pre><code>import io.dropwizard.Application;
  import io.dropwizard.java8.Java8Bundle;
  import io.dropwizard.setup.Bootstrap;
  import io.dropwizard.setup.Environment;
  
  /**
   * Created by Ido on 2/25/2015.
   */
  public class ExampleService extends Application&lt;Conf&gt; {
  
      public static void main(String [] args) throws Exception {
          new ExampleService().run(args);
      }
  
      @Override
      public String getName() {
          return "Hello World";
      }
  
      @Override
      public void initialize(Bootstrap&lt;Conf&gt; bootstrap) {
          bootstrap.addBundle(new Java8Bundle());
      }
  
      @Override
      public void run(Conf conf, Environment environment) throws Exception {
          final HelloResource resource = new HelloResource(
                  conf.getTemplate(),
                  conf.getDefaultName()
          );
  
          final TemplateHealthCheck healthCheck =
                  new TemplateHealthCheck(conf.getTemplate());
          environment.healthChecks().register("template", healthCheck);
          environment.
                  jersey().register(resource);
      }
  }
  </code></pre>
  
  <p>POM File</p>
  
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;ido.dropwizard.example&lt;/groupId&gt;
      &lt;artifactId&gt;dropwizard&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
  
      &lt;properties&gt;
          &lt;dropwizard.version&gt;0.7.1&lt;/dropwizard.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.dropwizard&lt;/groupId&gt;
              &lt;artifactId&gt;dropwizard-core&lt;/artifactId&gt;
              &lt;version&gt;${dropwizard.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.dropwizard.modules&lt;/groupId&gt;
              &lt;artifactId&gt;dropwizard-java8&lt;/artifactId&gt;
              &lt;version&gt;0.7.0-1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.dropwizard.modules&lt;/groupId&gt;
              &lt;artifactId&gt;dropwizard-java8-auth&lt;/artifactId&gt;
              &lt;version&gt;0.7.0-1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.dropwizard.modules&lt;/groupId&gt;
              &lt;artifactId&gt;dropwizard-java8-jdbi&lt;/artifactId&gt;
              &lt;version&gt;0.7.0-1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.6&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;createDependencyReducedPom&gt;true&lt;/createDependencyReducedPom&gt;
                      &lt;filters&gt;
                          &lt;filter&gt;
                              &lt;artifact&gt;*:*&lt;/artifact&gt;
                              &lt;excludes&gt;
                                  &lt;exclude&gt;META-INF/*.SF&lt;/exclude&gt;
                                  &lt;exclude&gt;META-INF/*.DSA&lt;/exclude&gt;
                                  &lt;exclude&gt;META-INF/*.RSA&lt;/exclude&gt;
                              &lt;/excludes&gt;
                          &lt;/filter&gt;
                      &lt;/filters&gt;
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;shade&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;transformers&gt;
                                  &lt;transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/&gt;
                                  &lt;transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
                                      &lt;mainClass&gt;ido.dropwizard.example.ExampleService&lt;/mainClass&gt;
                                  &lt;/transformer&gt;
                              &lt;/transformers&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;addDefaultImplementationEntries&gt;true&lt;/addDefaultImplementationEntries&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
          &lt;/plugins&gt;
      &lt;/build&gt;
  </code></pre>
  
  <p>I added the entire code because i really needs an answer because i gone through this problem on some other tutorials on youtube and google and couldn't get it to work...
  BTW when i tried to test this i typed on a browser - <a href="http://localhost:8080/hello-world/something" rel="nofollow">http://localhost:8080/hello-world/something</a> and also <a href="http://localhost:8080/hello-world" rel="nofollow">http://localhost:8080/hello-world</a>  => Didn't worked :)</p>
  
  <p>Well i will be very grateful for any help , Thanks :)</p>