HI David,
I need to remove that page as it is old. The latest is:
https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.0.1/jersey/getting-started.html
which is linked from the "start" icon on the main Jersey page. Notice
it states:
Lines 8 to 9 creates an initialization parameter that informs the
Jersey runtime where to search for root resource classes to be
deployed. In this case it assumes the root resource class in the
package com.sun.jersey.samples.helloworld.resources (or in a sub-
package of).
What is the package the HelloWorldResource class you created. It needs
to be "com.sun.jersey.samples.helloworld.resources" or a sub-package
of, and the class needs to be annotated with @Path.
You might also want to look at the complete sample here:
http://download.java.net/maven/2/com/sun/jersey/samples/helloworld/1.0.1/helloworld-1.0.1-project.zip
For getting started example you do not need Glassfish since the
embedded Grizzly server is being used. You can see a sample here that
can leverage GF:
http://download.java.net/maven/2/com/sun/jersey/samples/helloworld-webapp/1.0.1/helloworld-webapp-1.0.1-project.zip
Paul.
On Jan 8, 2009, at 5:29 PM, david kumoro wrote:
> Hi,
>
> I am totally new to jersey and glassfish and still trying to figure
> out how to make it work in my machine.
>
> I followed this test example below
>
> https://jersey.dev.java.net/use/getting-started.html
>
> But I get the exception as below
>
>
> Starting grizzly...
> Jersey app started with WADL available at http://localhost:9998/application.wadl
> ” + “Try out http://localhost:9998/helloworld
> Hit enter to stop it...
> Jan 8, 2009 10:19:22 AM
> com.sun.jersey.api.core.PackagesResourceConfig init
> INFO: Scanning for root resource and provider classes in the packages:
> com.sun.jersey.samples.helloworld.resources
> Jan 8, 2009 10:19:22 AM
> com.sun.jersey.impl.application.WebApplicationImpl
> processRootResources
> SEVERE: The ResourceConfig instance does not contain any root
> resource classes.
> Jan 8, 2009 10:19:22 AM com.sun.grizzly.http.servlet.ServletAdapter
> service
> SEVERE: service exception:
> com.sun.jersey.api.container.ContainerException: The ResourceConfig
> instance does not contain any root resource classes.
> at
> com
> .sun
> .jersey
> .impl
> .application
> .WebApplicationImpl.processRootResources(WebApplicationImpl.java:767)
> at
> com
> .sun
> .jersey
> .impl
> .application.WebApplicationImpl.initiate(WebApplicationImpl.java:668)
> at
> com
> .sun
> .jersey
> .impl
> .application.WebApplicationImpl.initiate(WebApplicationImpl.java:485)
> at
> com
> .sun
> .jersey
> .spi
> .container.servlet.ServletContainer.initiate(ServletContainer.java:
> 559)
> at
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.load(ServletContainer.java:
> 483)
> at
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> 165)
> at
> com
> .sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:
> 208)
> at
> com
> .sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:
> 148)
> at
> com
> .sun
> .grizzly
> .http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:
> 621)
> at
> com
> .sun
> .grizzly
> .http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:552)
> at
> com
> .sun
> .grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:
> 800)
> at
> com
> .sun
> .grizzly
> .http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
> at
> com
> .sun
> .grizzly
> .DefaultProtocolChain
> .executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com
> .sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:
> 104)
> at
> com
> .sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:
> 90)
> at com.sun.grizzly.http.SelectorThread
> $1.execute(SelectorThread.java:649)
> at
> com
> .sun
> .grizzly
> .ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
> at
> com
> .sun
> .grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
> at
> com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:169)
>
>
> I imported all the necessary jars (
> - asm3.1
> - grizzly-servlet-webserver-1.8.6.3
> - jersey-core-0-9-ea
> - jersey-server-0.9-ea
> - jsr311-api-0.9
>
> Do I need to have glassfish server running?
> I created this project above as java project, not a web dynamic
> project.
> I am not using maven as well.
>
> Any help will be very much appreciate it.
>
> Thanks
>
> David
>
>
>