1 Reply Latest reply on Apr 21, 2011 12:55 PM by gillonv

    ResteasyHandlerMapping Resource Not Found

    gillonv Newbie

      Hi,

      I am fairly new with Resteasy webServices and trying to implement a small webservice using RestEasy with Spring.

       

      My WAR deploys fine on Jboss 5.1, but when I try to request my webservice it gives me:

      org.jboss.resteasy.spi.NotFoundException: Could not find resource.

       

      I am thinking the DispatcherServlet is not doing the job correctly but I think I have the right configuration.

       

      Web.xml is as:

      <servlet>

              <servlet-name>springmvc</servlet-name>

              <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

              <init-param>

                  <param-name>contextConfigLocation</param-name>

                  <param-value>classpath:springmvc-servlet.xml</param-value>

              </init-param>

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

          </servlet>

          <servlet-mapping>

              <servlet-name>springmvc</servlet-name>

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

          </servlet-mapping>

       

      springmvc-servlet.xml:

      <context:component-scan base-package="com.example.myapp"/>

          <context:annotation-config />

          <import resource="classpath:application-daoContext.xml"/>

          <import resource="classpath:springmvc-resteasy.xml" />

          <bean id="viewResolver"

              class="org.springframework.web.servlet.view.InternalResourceViewResolver">

              <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />

              <property name="prefix" value="/WEB-INF/" />

              <property name="suffix" value=".jsp" />

          </bean>

       

       

      Just, FYI server logging:

      12:40:09,694 INFO  [Version] Hibernate Annotations 3.4.0.GA_CP01

      12:40:09,709 INFO  [Environment] Hibernate 3.3.2.GA_CP03

      12:40:09,709 INFO  [Environment] hibernate.properties not found

      12:40:09,709 INFO  [Environment] Bytecode provider name : javassist

      12:40:09,709 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling

      12:40:09,803 INFO  [Version] Hibernate Commons Annotations 3.1.0.GA

      12:40:09,881 INFO  [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.

      12:40:09,881 INFO  [ConnectionProviderFactory] Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider

      12:40:10,929 INFO  [SettingsFactory] RDBMS: Oracle, version: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production

      With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

      Data Mining and Real Application Testing options

      12:40:10,929 INFO  [SettingsFactory] JDBC driver: Oracle JDBC driver, version: 11.2.0.1.0

      12:40:10,976 INFO  [Dialect] Using dialect: org.hibernate.dialect.Oracle10gDialect

      12:40:11,023 INFO  [TransactionFactoryFactory] Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory

      12:40:11,039 INFO  [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)

      12:40:11,039 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): disabled

      12:40:11,039 INFO  [SettingsFactory] Automatic session close at end of transaction: disabled

      12:40:11,039 INFO  [SettingsFactory] JDBC batch size: 15

      12:40:11,039 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled

      12:40:11,039 INFO  [SettingsFactory] Scrollable result sets: enabled

      12:40:11,039 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): disabled

      12:40:11,039 INFO  [SettingsFactory] Connection release mode: auto

      12:40:11,039 INFO  [SettingsFactory] Default batch fetch size: 1

      12:40:11,039 INFO  [SettingsFactory] Generate SQL with comments: enabled

      12:40:11,039 INFO  [SettingsFactory] Order SQL updates by primary key: disabled

      12:40:11,039 INFO  [SettingsFactory] Order SQL inserts for batching: disabled

      12:40:11,039 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory

      12:40:11,039 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory

      12:40:11,039 INFO  [SettingsFactory] Query language substitutions: {}

      12:40:11,039 INFO  [SettingsFactory] JPA-QL strict compliance: disabled

      12:40:11,039 INFO  [SettingsFactory] Second-level cache: enabled

      12:40:11,039 INFO  [SettingsFactory] Query cache: disabled

      12:40:11,039 INFO  [SettingsFactory] Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory

      12:40:11,039 INFO  [SettingsFactory] Optimize cache for minimal puts: disabled

      12:40:11,039 INFO  [SettingsFactory] Structured second-level cache entries: disabled

      12:40:11,039 INFO  [SettingsFactory] Echoing all SQL to stdout

      12:40:11,039 INFO  [SettingsFactory] Statistics: disabled

      12:40:11,039 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled

      12:40:11,039 INFO  [SettingsFactory] Default entity-mode: pojo

      12:40:11,039 INFO  [SettingsFactory] Named query checking : enabled

      12:40:11,101 INFO  [SessionFactoryImpl] building session factory

      12:40:11,101 INFO  [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured

      12:40:11,179 INFO  [ResteasyHandlerMapping] ResteasyHandlerMapping has the default order and throwNotFound settings.  Consider adding explicit ordering to your HandlerMappings, with ResteasyHandlerMapping being lsat, and set throwNotFound = true.

      12:40:27,913 WARN  [ResteasyHandlerMapping] Resource Not Found: Could not find resource for relative : /births/member/1 of full path: http://localhost:8080/myapp/births/member/1

      org.jboss.resteasy.spi.NotFoundException: Could not find resource for relative : /births/member/1 of full path: http://localhost:8080/myapp/births/member/1

          at org.jboss.resteasy.core.registry.RootSegment.matchChildren(RootSegment.java:360)

          at org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:374)

          at org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:367)

          at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:251)

          at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:157)

          at org.jboss.resteasy.springmvc.ResteasyHandlerMapping.getInvoker(ResteasyHandlerMapping.java:99)

          at org.jboss.resteasy.springmvc.ResteasyHandlerMapping.getHandler(ResteasyHandlerMapping.java:76)

          at org.springframework.web.servlet.DispatcherServlet.getHandler(DispatcherServlet.java:1057)

          at org.springframework.web.servlet.DispatcherServlet.getLastModified(DispatcherServlet.java:959)

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

          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.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:183)

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

          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:598)

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

          at java.lang.Thread.run(Thread.java:619)