users@jersey.java.net

Re: [Jersey] Getting nuts with hangs in Client API

From: Naresh <Srinivas.Bhimisetty_at_Sun.COM>
Date: Thu, 24 Sep 2009 19:29:47 +0530
Paul Sandoz wrote:

On Sep 8, 2009, at 9:48 AM, Markus KARG wrote:

Paul,
 
thank you for your tips and have nice holidays! Just came back from a great short trip to Vienna, so if you don't know where to go to… ;-)
 

:-)


The idea with a 10 minutes sleep didn't help. :-(
 
Changing to Grizzly works well (but one really must give the package to scan or Jersey will tell you that "C:\C:\jersey-archive-1.0.3.1\lib\jsr311-api-1.0.jar, is not a jar file")! :-)
 

Ug, that looks like a silly windows bug. We will investigate.
I tried running a simple application on Windows Vista, and it did run just fine.
Here's an extract of what I see upon running the app:
------------------------------------------------------------------------------------------------------------------
24 Sep, 2009 4:07:46 PM com.sun.jersey.api.core.ClasspathResourceConfig init
INFO: Scanning for root resource and provider classes in the paths:
C:\space\naresh\workspace\JerseyClassPathScanningDemo\lib\asm-3.1.jar
C:\space\naresh\workspace\JerseyClassPathScanningDemo\lib\jersey-bundle-1.1.2-ea.jar
C:\space\naresh\workspace\JerseyClassPathScanningDemo\lib\jsr311-api-1.1.jar
C:\space\naresh\workspace\JerseyClassPathScanningDemo\lib\grizzly-servlet-webserver-1.9.8.jar
C:\space\naresh\workspace\JerseyClassPathScanningDemo\build\classes
C:\space\naresh\workspace\JerseyClassPathScanningDemo\src

24 Sep, 2009 4:07:46 PM com.sun.jersey.api.core.ClasspathResourceConfig init
INFO: Root resource classes found:
class jerseyclasspathscanningdemo.resources.MyResource
24 Sep, 2009 4:07:46 PM com.sun.jersey.api.core.ClasspathResourceConfig init
INFO: Provider classes found:
24 Sep, 2009 4:07:47 PM com.sun.jersey.server.impl.application.WebApplicationImpl initiate
INFO: Initiating Jersey application, version 'Jersey: 1.1.2-ea 08/25/2009 04:43 PM'
24 Sep, 2009 4:07:49 PM com.sun.jersey.api.client.filter.LoggingFilter log
INFO: 1 * Client out-bound request
1 > GET http://localhost:9989/resources/myresource
1 > Accept: text/plain
1 >

24 Sep, 2009 4:07:49 PM com.sun.jersey.api.client.filter.LoggingFilter log
INFO: 1 * Client in-bound response
Hi!!!
1 < 200
1 < Transfer-Encoding: chunked
1 < Content-Type: text/plain
1 < Date: Thu, 24 Sep 2009 10:37:49 GMT
1 <
Hi!!!
------------------------------------------------------------------------------------------------------------------

    And here's an extract from the code which creates the SelectorThread:

...
SelectorThread st = GrizzlyServerFactory.create("http://localhost:9989/resources");
...

-Naresh




So I assume that there is a bug in the http server used internally by Jersey, and there is a bug in Jersey's ClassPath scanner (it seems to add another C:\ to each JAR if not giving a package to scan).
 
For my presentation, this should work. But maybe you like to have a look into the the above items after your holidays? :-)

OK.

I have wasted way too much time with the LW HTTP server and its issues! In my experience it is not stable on windows. I can only suggest logging an issue against the JDK.

Paul.