|
From: Michael M. <mmu...@re...> - 2011-02-09 14:31:09
|
Which threading model are you using. I got the error you are seeing once with the Singleton model but when I moved to the per request model for my resources the error went away. I'm afraid that I was unable to track down why the Singleton model wasn't working. Mike > Hi > > I still can't create a restful service with resteasy. And I don't > understand what's wrong. > > When I created a simple web application from scratch and created and > deployed .WAR I get this exception > > When starting an application I get this exception !!! > > java.lang.NullPointerException > org.scannotation.WarUrlFinder.findWebInfLibClasspaths(WarUrlFinder.java:27) > org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap.getScanningUrls(ListenerBootstrap.java:33) > org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap.createDeployment(ConfigurationBootstrap.java:163) > org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap.createDeployment(ListenerBootstrap.java:26) > org.jboss.resteasy.plugins.server.servlet.ServletBootstrap.createDeployment(ServletBootstrap.java:25) > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:66) > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) > org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) > org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) > org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) > org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) > org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) > org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) > java.lang.Thread.run(Thread.java:662) > Web.xml > > <?xml version="1.0" encoding="UTF-8"?> <web-app > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns="http://java.sun.com/xml/ns/javaee" > xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee > http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" > version="2.5"> <display-name>test-resteasy</display-name> > <context-param> <param-name>resteasy.scan</param-name> > <param-value>true</param-value> </context-param> > > <listener> > > <listener-class> > org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap > </listener-class> > </listener> > > <servlet> <servlet-name>Resteasy</servlet-name> > <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> > </servlet> <servlet-mapping> <servlet-name>Resteasy</servlet-name> > <url-pattern>/rest/*</url-pattern> </servlet-mapping> > <welcome-file-list> <welcome-file>/index.html</welcome-file> > </welcome-file-list> </web-app> > > my resource test class ... > > @Path("test") public class TestResource { @GET @Path("hello") > public String HelloWorld() { return "Hello restfull world!!!"; } } > > When I create a maven project and deploy application with same web.xml > and same resource class I get > > StandardWrapper.Throwable: java.lang.RuntimeException: Class is > not a root resource. It, or one of its interfaces must be > annotated with @Path: com.dropchop.rest.TestResource implements: > at > org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:104) > [:6.0.0.Final] > at > org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83) > [:6.0.0.Final] > at > org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:72) > [:6.0.0.Final] > .... > > I'm using clean install of JBoss AS 6, the version of RESTeasy that > came with it is 2.1.0.GA <http://2.1.0.GA> > Any Help would be greatly appreciated. > KInd regards > Armando > > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > > > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |