|
From: Oliver V. <oli...@go...> - 2011-04-04 12:42:34
|
David, thanks for replying to my request. Unfortunately your suggestion didn't work out either... I still get a 404: HTTP Status 404 - /RestTest/test/foo type Status report message /RestTest/test/foo description The requested resource (/RestTest/test/foo) is not available. JBoss Web/3.0.0-CR1 I'm afraid my annotated service-class is not being recognized but I cannot figure out what's the missing part. Is it correct that it is not required to provide any servlet-information within the web.xml descriptor? I guess the annotations should be sufficient but it's not working... -Oliver 04.04.2011 14:21, David Haynes: > I bet it you try http://localhost/RestTest/test/foo you will get what > you expected. > The @Path sets the prefix for the method but you have to reference the > method too. > > -david- > > On Sun, Apr 3, 2011 at 12:45 PM, Oliver Vesper > <oli...@go... <mailto:oli...@go...>> wrote: > > Hi, > > first of all: I am totally new to RESTEasy! > > I'm trying to deploy a small and simple restful service to a fresh > installation of JBoss AS 6.0 FINAL (running the default configuration > which includes the resteasy-deployers). My WAR file (RestTest.war) > contains the following two files: > - WEB-INF/web.xml > - test/resteasy/MyService.class > > The web.xml looks like this: > > <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee > http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> > </web-app> > > The source-code for MyService-class as follows: > > package test.resteasy; > import javax.ws.rs.GET; > import javax.ws.rs.Path; > @Path("test") > public class MyService { > @GET > public String foo() { > return "Hello World"; > } > } > > As I haven't annotated the foo-method with another @Path-annotation I > assume it should be accessible by the following URL: > http://localhost:8080/RestTest/test > > But I only get a HTTP-404-error. > > I debugged into ResteasyScannerDeployer (and also > ResteasyIntegrationDeployer) and it looks like my @Path-annotated class > is not being recognized. It looks like the scan-method of > ResteasyScannerDeployer tries to find those classes which are annotated > with @Path: > > Set<Element<Path, Class<?>>> resources = null; > Set<Element<Provider, Class<?>>> providers = null; > if (resteasyDeploymentData.isScanResources()) > { > resources = env.classIsAnnotatedWith(Path.class); > } > > But after calling "classIsAnnotatedWith(Path.class)" the > resources-variable is set to an empty collection. > > I would really appreciate anybody giving me a hint to what I'm doing > wrong. Thanks a lot! > > -Oliver > > ------------------------------------------------------------------------------ > Create and publish websites with WebMatrix > Use the most popular FREE web apps or write code yourself; > WebMatrix provides all the features you need to develop and > publish your website. http://p.sf.net/sfu/ms-webmatrix-sf > _______________________________________________ > Resteasy-users mailing list > Res...@li... > <mailto:Res...@li...> > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > |