users@jersey.java.net

[Jersey] Issue migrating from Jersey 1.10 to 1.12

From: Olivier Bourdon <olivier.bourdon_at_usharesoft.com>
Date: Fri, 13 Apr 2012 15:04:56 +0200

Hello

we have been using Jersey for quite a while now and seems like
transitioning from our 1.10 code to 1.12 is not so obvious as previously
We had a testing standalone application (read jar not war) which did the
following in its main part:

import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory;
import com.sun.grizzly.http.SelectorThread;
...
public class FactoryServer {
...
  private static SelectorThread threadSelector;
...
     public static void main(String[] args) throws IOException {
...
         Map<String, String> initParams = new HashMap<String, String>();
         // The following line allows tracing of URI matching vs rest patterns for all requests
         initParams.put(ResourceConfig.FEATURE_TRACE, "true");
         // Where to look for Rest resources
         initParams.put(PackagesResourceConfig.PROPERTY_PACKAGES, "com.usharesoft.rest.resources.user;com.usharesoft.rest.resources.common");
         initParams.put(PackagesResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, "com.usharesoft.rest.filters.ClientFilter;com.usharesoft.rest.filters.ErrorFilter");
         URI uri = UriBuilder.fromUri("http://localhost").port(9090).path("/test").build();;
         threadSelector = GrizzlyWebContainerFactory.create(uri, initParams);
...
         byte[] b = new byte[40];
         //int n = System.in.read(b);
         try {
             while (true) {
                 Thread.sleep(3600000);
             }
         } catch (Exception e) {
             //
         }


and we were using the following jars
grizzly-servlet-webserver-1.9.36.jar
jersey-grizzly-1.10.jar
in addition to the "standard" jersey jars

We understand that due to some refactoring of the Grizzly parts this has
changed but we can not figure out how to move from old to new

Thanks for any pointers/help

Best regards

Olivier