users@jersey.java.net

[Jersey] Re: servlet start error

From: Glen Mazza <gmazza_at_talend.com>
Date: Mon, 20 Feb 2012 09:00:13 -0500

Besides John's comment, you might wish to get either the
helloworld-webapp or simple-servlet examples from the Jersey samples
download
(http://maven.java.net/service/local/artifact/maven/redirect?r=releases&g=com.sun.jersey.samples&a=jersey-samples&v=1.11&e=zip&c=project)
working first on your machine, then take what is learned to your own
projects to get them to work.

Glen

On 02/20/2012 08:33 AM, John Yeary wrote:
> Are there any @Path annotated resources in the com.wgf.ui package?
> ____________________________
>
> John Yeary
> ____________________________
>
> <http://javaevangelist.blogspot.com/> <https://twitter.com/jyeary>
> <http://www.youtube.com/johnyeary> <http://www.linkedin.com/in/jyeary>
> <https://plus.google.com/112146428878473069965>
> <http://www.facebook.com/jyeary>
> <http://feeds.feedburner.com/JavaEvangelistJohnYearysBlog>
> <http://netbeans.org/people/84414-jyeary>
> ____________________________
>
> "Far better it is to dare mighty things, to win glorious triumphs,
> even though checkered by failure, than to take rank with those poor
> spirits who neither enjoy much nor suffer much, because they live in
> the gray twilight that knows not victory nor defeat."
> -- Theodore Roosevelt
>
>
>
> On Sun, Feb 19, 2012 at 9:35 PM, George jiang
> <george.jiangxy_at_gmail.com <mailto:george.jiangxy_at_gmail.com>> wrote:
>
> I use the the jersey developing a RESTful the service, the server
> is tomcat7.0.23, the server.xml configuration:
> <servlet>
> <servlet-name>Jersey REST Service</servlet-name>
> <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
> <init-param>
> <param-name>com.sun.jersey.config.property.packages</param-name>
> <param-value>com.wgf.ui</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>Jersey REST Service</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
> Often start the server reported the following error:
> HTTP Status 500 -
> type Exception report
> message
> description The server encountered an internal error () that
> prevented it from fulfilling this request.
> exception
> javax.servlet.ServletException: Servlet.init() for servlet Jersey
> REST Service threw exception
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> java.lang.Thread.run(Thread.java:680)
>
> root cause
> com.sun.jersey.api.container.ContainerException: The
> ResourceConfig instance does not contain any root resource classes.
> com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:99)
> com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1298)
> com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:169)
> com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:775)
> com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:771)
> com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
> com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:771)
> com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:766)
> com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
> com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
> com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)
> com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
> com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
> com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
> javax.servlet.GenericServlet.init(GenericServlet.java:160)
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> java.lang.Thread.run(Thread.java:680)
>
> note The full stack trace of the root cause is available in the
> Apache Tomcat/7.0.23 logs.
>
>


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza