3 Replies Latest reply on Apr 1, 2009 3:45 PM by enrico256

    Can't get RESTeasy to work

    enrico256

      Hello,


      using Eclipse 3.4, JBossTools 3.0.0.CR2 I have created a basic SEAM 2.1 project (called seam2.1). From the documentation I have cut and pasted the following class definition:


      package org.domain.seam21.session;
      
      import javax.ws.rs.GET;
      import javax.ws.rs.Path;
      import javax.ws.rs.PathParam;
      import javax.ws.rs.ProduceMime;
      
      @Path("/customer")
      public class MyCustomerResource {
      
          @GET
          @Path("/{customerId}")
          @ProduceMime("text/plain")
          public String getCustomer(@PathParam("customerId") int id) {
               return "hello" + id;
          }
      
      }
      



      I have built the project and installed the ear file on a JBoss 4.2.3 AS.


      My problem is that I can't get the application to answer any RESTeasy request. In particular




      Any help is much appreciated!


      Enrico

        • 1. Re: Can't get RESTeasy to work
          enrico256

          Sorry for the mistake: I'm actually testing on JBoss AS 4.2.2...


          Enrico

          • 2. Re: Can't get RESTeasy to work
            enrico256

            Looking at the JBoss log at startup I noticed the following lines:



            ...
            15:13:55,934 INFO  [ServletContextListener] Welcome to Seam 2.1.1.GA
            15:13:56,059 INFO  [Scanner] skipping class org/jboss/seam/resteasy/ResteasyDispatcher.class because it cannot be loaded (may reference a type which is not available on the classpath)
            ...



            Do I need to add resteasy jars to the project?


            Thanks, Enrico

            • 3. Re: Can't get RESTeasy to work
              enrico256

              Obviously yes.


              As described in section 24.4.1 in the doc get the RESTEasy libraries and the jaxrs-api.jar, deploy them with the other libraries of your application.


              I was missing resteasy-jaxrs.jar...