title: Grizzly and Jersey standalone jar
body: <p>I am trying to package Grizzly with Jersey as a single jar using Maven shade plugin. But I always get the message <code>No container provider supports the type class org.glassfish.grizzly.http.server.HttpHandler</code></p>
  
  <p>The code works fine in Eclipse, but not in a packaged jar:</p>
  
  <pre><code>public class Main {
  
  private static URI getBaseURI() {
      return UriBuilder.fromUri("http://localhost/").port(9998).build();
  }
  
  public static final URI BASE_URI = getBaseURI();
  
  protected static HttpServer startServer() throws IOException {
      System.out.println("Starting grizzly...");
      ResourceConfig rc = new PackagesResourceConfig("share.test");
      rc.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
      return GrizzlyServerFactory.createHttpServer(BASE_URI, rc);
  }
  
  public static void main(String[] args) throws IOException {
      HttpServer httpServer = startServer();
      System.in.read();
      httpServer.stop();
  }    
  }
  </code></pre>
  
  <p>Here is the complete exception </p>
  
  <pre><code>$ java -jar target/webServiceTest-0.0.1-SNAPSHOT.jar
  Starting grizzly...
  Mar 20, 2012 12:48:53 PM com.sun.jersey.api.core.PackagesResourceConfig init
  INFO: Scanning for root resource and provider classes in the packages:
    share.test
  Mar 20, 2012 12:48:54 PM com.sun.jersey.api.core.ScanningResourceConfig logClasses
  INFO: Root resource classes found:
    class share.test.NonJAXBBeanResource
    class share.test.Hello
  Mar 20, 2012 12:48:54 PM com.sun.jersey.api.core.ScanningResourceConfig init
  INFO: No provider classes found.
  Exception in thread "main" java.lang.IllegalArgumentException: No container provider supports the type class org.glassfish.grizzly.http.server.HttpHandler
      at com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:196)
      at com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:134)
      at com.sun.jersey.api.container.grizzly2.GrizzlyServerFactory.createHttpServer(GrizzlyServerFactory.java:242)
      at share.test.Main.startServer(Main.java:27)
      at share.test.Main.main(Main.java:31)
  </code></pre>
  
  <p>I am building the jar package using maven with</p>
  
  <pre><code>&lt;build&gt;
   &lt;plugins&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.5&lt;/version&gt;
     &lt;configuration&gt;
     &lt;transformers&gt;
     &lt;transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
       &lt;manifestEntries&gt;
        &lt;Main-Class&gt;share.test.Main&lt;/Main-Class&gt;
        &lt;Build-Number&gt;1&lt;/Build-Number&gt;
       &lt;/manifestEntries&gt;
      &lt;/transformer&gt;
    &lt;/transformers&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;/execution&gt;
  &lt;/executions&gt;
  &lt;/plugin&gt;
  &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>Do I need to change the shade plugin to include anything else?</p>