users@jersey.java.net

[Jersey] Re: Jersey resource is not found on Grizzly 2.2.1

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Mon, 30 Jan 2012 07:37:47 +0100

Hello Philipp,

can you share class com.example.rest.HelloWorldResource (especially used
@Path annotations)? Are you sure that you are trying to access correct
url? It should look like: http://host:port/content-path/resource-path
where "host:port/content-path" is set in grizzly/web.xml and the rest is
handled in your application.

also, which version of jersey are you using? you might want to take a
look at helloworld or helloworld-webapp samples, see
https://maven.java.net/content/repositories/snapshots/com/sun/jersey/samples/

Regards,
Pavel


On 1/29/12 9:17 PM, justphilmusic_at_googlemail.com wrote:
> Hello everybody!
>
> I've already used older versions of Jersey (e.g. v1.8) in conjunction
> with Grizzly (e.g. v1.9) with great success.
>
> Now, I'm about to start a new project which makes extensive use of some
> WebSocket improvements that have been introduced in the 2.2.1 release
> of Grizzly. Furthermore, I want to use Jersey with the mentioned
> Grizzly release.
>
> However, I cannot make Grizzly to find my Jersey resources.
>
> In order to exclude possible errors in my code, I've started to test
> the Jersey example from the "Getting Started" chapter with the new
> Grizzly 2.2.1 release. After running the server the log output looks
> good (see below). However, when I point my browser to
> http://localhost:9998/helloworld I get Grizzly's "Resource Not Found"
> page instead of the output of the Jersey resource.
>
> Are there any hints on using Jersey with Grizzly's v2.2.1 release?
>
> I appreciate all tips regarding this topic!
>
> Bye,
> Philipp
>
>
> Starting grizzly...
> 29.01.2012 20:42:36 com.sun.jersey.api.core.PackagesResourceConfig init
> INFO: Scanning for root resource and provider classes in the packages:
> com.example.rest
> 29.01.2012 20:42:36 com.sun.jersey.api.core.ScanningResourceConfig
> logClasses
> INFO: Root resource classes found:
> class com.example.rest.HelloWorldResource
> 29.01.2012 20:42:36 com.sun.jersey.api.core.ScanningResourceConfig init
> INFO: No provider classes found.
> 29.01.2012 20:42:36
> com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
> INFO: Initiating Jersey application, version 'Jersey: 1.11 12/09/2011
> 10:27 AM'
> 29.01.2012 20:42:37 org.glassfish.grizzly.http.server.NetworkListener
> start
> INFO: Started listener bound to [localhost:9998]
> 29.01.2012 20:42:37 org.glassfish.grizzly.http.server.HttpServer start
> INFO: [HttpServer] Started.
> Jersey app started with WADL available at
> http://localhost:9998/application.wadl
> Try out http://localhost:9998/helloworld
> Hit enter to stop it...
>