users@jersey.java.net

[Jersey] Re: Issue migrating from Jersey 1.10 to 1.12

From: Arul Dhesiaseelan <aruld_at_acm.org>
Date: Fri, 13 Apr 2012 07:30:47 -1000

If you plan to use jersey-grizzly2 module, you should consider changing
your deployment code as shown here:
http://jersey.java.net/nonav/documentation/latest/user-guide.html#d4e54

Your existing deployment should still work with jersey-grizzly module. What
problems you are seeing?

-Arul

On Fri, Apr 13, 2012 at 3:04 AM, Olivier Bourdon <
olivier.bourdon_at_usharesoft.com> wrote:

> 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 <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
>
>