Problem with RESTeasy
lbot Oct 9, 2008 12:17 AMHello,
i'm trying to integrate RESTeasy with SEAM 2.1.0.CR1 into my application. I started with a very simple test and ran into problems.
This is my ressource class:
@Stateful @Scope(ScopeType.EVENT) @Name("dokumentenRessource") @Path("/dokument") public class DokumentenRessourceBean implements DokumentenRessource { @GET @ProduceMime("text/plain") @Path("/id") public String getTest( @PathParam("id") int id ) { return "Servus " + id; } @Destroy @Remove public void destroy() {} }
The interface has no REST annotations. I deployed jboss-seam-resteasy.jar, resteasy-jaxrs.jar and jaxrs-api.jar with the libraries of my application.
I got the following error when the jboss server starts.
22:18:21,543 ERROR [[/bxtranet]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.resteasy.dispatcher at org.jboss.seam.Component.newInstance(Component.java:2049) at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) at org.jboss.seam.contexts.ServletLifecycle.endIn..... ... ... at org.jboss.Main$1.run(Main.java:508) at java.lang.Thread.run(Thread.java:613) Caused by: java.lang.RuntimeException: Class is not a root resource. It, or one of its interfaces must be annotated with @Path: com.bxtranet.basic.session.DokumentenRessourceBean implements: com.bxtranet.basic.session.DokumentenRessource at org.resteasy.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:104) at org.resteasy.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83) at org.jboss.seam.resteasy.ResteasyDispatcher.onStartup(ResteasyDispatcher.java:54)
I also tried to annotate the interface or use a POJO as resource class but i got the same error. Now i'm running out of ideas. Did i miss something ?