|
From: Oliver V. <oli...@go...> - 2011-04-03 16:45:41
|
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 |