users@grizzly.java.net

Re: grizzly + jersey hangs

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Thu, 28 Jun 2012 18:05:19 +0200

Hi,

can you pls. create a testcase project (maven2 based would be great) we
can run to reproduce the problem?

Thanks.

WBR,
Alexey.

On 06/27/2012 11:57 PM, koert_at_tresata.com wrote:
> i create a simple grizzly webserver that handles my jersey based jax-rs
> requests.
>
> the trouble is, as soon as i do anything in my jax-rs annotated methods
> that involves logging, or writing to stdout, the webserver never
> responds to any requests
>
> using wget, i see "HTTP request sent, awaiting response..", and it will
> stay like that forever.
> if i remove my logging or printing statements (or if i change the
> logging level so that there is no logging) everything works fine.
>
> any suggestions?
>
> this is how i start my webserver:
>
> private static HttpServer startServer() throws IOException {
> System.out.println("Starting grizzly...");
> final HttpServer server = new HttpServer();
> server.addListener(new NetworkListener("grizzly",
> NetworkListener.DEFAULT_NETWORK_HOST, 9998));
> final WebappContext ctx = new WebappContext("main");
> ctx.addServlet("demo", new ServletContainer(new
> DemoApplication())).addMapping("/demo");
> ctx.deploy(server);
> server.start();
> return server;
> }
>
>
> this is a simpel jax-rs annotated method:
>
> @Path("/items/{name}")
> @GET
> @Produces("application/json")
> public JSONObject get(@Context SecurityContext sec,
> @PathParam("name") final String name) throws IOException {
> LOGGER.debug("gettting {}", name);
> return jsonStore.get(name); // throws IOException
> }