0 Replies Latest reply: Apr 20, 2012 2:47 PM by Wilson Lima RSS

    Seam 2.1.1 + RestEasy + JBoss AS 5.0.1

    Wilson Lima Newbie

      Hello, I have been for 2 days researching and trying to make a sort of HelloWorld using Seam 2.1.1 + RestEasy + JBoss AS 5.0.1.

       

      After some jar changes and inclusions and web.xml configuration I could manage the server startup without deployment errors and apparently with the rest servlet working. But whenever I try to access the service by typing the url on the browser I get this exception when I type in the browser:

       

      URL

      http://localhost:8080/myapp/rest/ping

       

      Exception

      15:24:15,392 INFO  [ServerImpl] JBoss (Microcontainer) [5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902232048)] Started in 2m:20s:461ms

      15:24:29,766 INFO  [Contexts] starting up: org.jboss.seam.security.identity

      15:24:29,771 INFO  [Contexts] starting up: org.jboss.seam.security.ruleBasedPermissionResolver

      15:24:30,360 INFO  [RuleBase] parsing rules: /security.drl

      15:24:30,737 INFO  [Contexts] starting up: org.jboss.seam.web.session

      15:24:30,785 WARN  [ExceptionFilter] handling uncaught exception

      org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: Unable to determine entity id class.

          at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:296)

          at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:208)

          at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:187)

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:371)

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:160)

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:113)

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:69)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)

          at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)

          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)

          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)

          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)

          at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)

          at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

          at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.RuntimeException: Unable to determine entity id class.

          at org.jboss.seam.resteasy.ResourceHome.getEntityIdClass(ResourceHome.java:360)

          at org.jboss.seam.resteasy.ResourceHome.unmarshallId(ResourceHome.java:292)

          at org.jboss.seam.resteasy.ResourceHome.getResource(ResourceHome.java:110)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:119)

          at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:211)

          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:176)

          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)

          ... 46 more

      15:24:30,787 WARN  [ExceptionFilter] exception root cause

      java.lang.RuntimeException: Unable to determine entity id class.

          at org.jboss.seam.resteasy.ResourceHome.getEntityIdClass(ResourceHome.java:360)

          at org.jboss.seam.resteasy.ResourceHome.unmarshallId(ResourceHome.java:292)

          at org.jboss.seam.resteasy.ResourceHome.getResource(ResourceHome.java:110)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:119)

          at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:211)

          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:176)

          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:160)

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:113)

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:69)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)

          at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)

          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)

          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)

          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)

          at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)

          at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

          at java.lang.Thread.run(Unknown Source)

      15:24:30,787 WARN  [ExceptionFilter] running exception handlers

       

       

      WEB.XML

       

      <?xml version="1.0" ?>

      <web-app 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_2_5.xsd"

         version="2.5">

       

         <!-- RichFaces -->

       

         <context-param>

            <param-name>org.richfaces.SKIN</param-name>

            <param-value>wine</param-value>

         </context-param>

       

         <!-- Suppress spurious stylesheets -->

       

         <context-param>

            <param-name>org.richfaces.CONTROL_SKINNING</param-name>

            <param-value>disable</param-value>

         </context-param>

       

         <context-param>

            <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>

            <param-value>disable</param-value>

         </context-param>

       

         <!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->

       

         <context-param>

            <param-name>org.richfaces.LoadStyleStrategy</param-name>

            <param-value>ALL</param-value>

         </context-param>

       

         <context-param>

            <param-name>org.richfaces.LoadScriptStrategy</param-name>

            <param-value>ALL</param-value>

         </context-param>

       

         <!-- Seam -->

       

         <listener>

            <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>

         </listener>

       

         <filter>

            <filter-name>Seam Filter</filter-name>

            <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>

         </filter>

       

         <filter-mapping>

            <filter-name>Seam Filter</filter-name>

            <url-pattern>/*</url-pattern>

         </filter-mapping>

       

         <servlet>

            <servlet-name>Seam Resource Servlet</servlet-name>

            <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>

         </servlet>

       

         <servlet-mapping>

            <servlet-name>Seam Resource Servlet</servlet-name>

            <url-pattern>/seam/resource/*</url-pattern>

         </servlet-mapping>

       

         <!-- Facelets development mode (disable in production) -->

       

         <context-param>

            <param-name>facelets.DEVELOPMENT</param-name>

            <param-value>true</param-value>

         </context-param>

       

         <!-- JSF -->

       

         <context-param>

            <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

            <param-value>.xhtml</param-value>

         </context-param>

       

         <servlet>

            <servlet-name>Faces Servlet</servlet-name>

            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

            <load-on-startup>1</load-on-startup>

         </servlet>

       

         <servlet-mapping>

            <servlet-name>Faces Servlet</servlet-name>

            <url-pattern>*.seam</url-pattern>

         </servlet-mapping>

       

         <security-constraint>

            <display-name>Restrict raw XHTML Documents</display-name>

            <web-resource-collection>

               <web-resource-name>XHTML</web-resource-name>

               <url-pattern>*.xhtml</url-pattern>

            </web-resource-collection>

            <auth-constraint/>

         </security-constraint>

        

         <!-- Auto scan REST service -->

          <context-param>

              <param-name>resteasy.scan</param-name>

              <param-value>true</param-value>

          </context-param>

         

         

       

          <context-param>

              <param-name>resteasy.servlet.mapping.prefix</param-name>

              <param-value>/rest</param-value>

          </context-param>

       

          <listener>

              <listener-class>

                  org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap

              </listener-class>

          </listener>

       

          <servlet>

              <servlet-name>resteasy-servlet</servlet-name>

              <servlet-class>

                  org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher

              </servlet-class>

          </servlet>

       

          <servlet-mapping>

              <servlet-name>resteasy-servlet</servlet-name>

              <url-pattern>/rest/*</url-pattern>

          </servlet-mapping>

       

      </web-app>

       

      SERVICE CLASS

       

      @Name("ping")

      @Path("/ping")

      public class PingService {

          @GET

          public String get() {

              return "Teste";

          }

      }

       

       

      Could someone give me a hint.

       

      Regards

      Wilson