2 Replies Latest reply on Jul 10, 2012 11:30 AM by Srikrishna Kalavacharla

    jboss 7.1.1 - RESTEasy - Deploying to root context - How to access jsp pages in root context ?

    Srikrishna Kalavacharla Newbie

      We have something as follows:

       

      package com.company.project.control.impl;
      
      
      @Path("/")
      @ApplicationPath("/")
      public class SampleResource extends Application implements SampleService
      {
      
      ....
      ....
      }
      

       

      And we also have some jsp pages in the root as follows (This is a Dynamic Web Project):

       

      SampleService/a.jsp
      SampleService/b.jsp
      

       

      When I try accessing a.jsp or b.jsp at http://localhost:8080/a.jsp or http://localhost:8080/b.jsp I get the following error:

       

      11:34:18,731 DEBUG [org.jboss.modcluster.ModClusterService] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) Check status for engine [jboss.web]
      11:34:28,733 DEBUG [org.jboss.modcluster.ModClusterService] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) Check status for engine [jboss.web]
      11:34:32,963 INFO  [org.jboss.resteasy.spi.ResteasyDeployment] (http--127.0.0.1-8180-1) Deploying javax.ws.rs.core.Application: class com.company.project.control.impl.SampleResource
      11:34:33,231 DEBUG [org.jboss.resteasy.core.SynchronousDispatcher] (http--127.0.0.1-8180-1) PathInfo: /a.jsp
      11:34:33,232 DEBUG [org.jboss.resteasy.core.SynchronousDispatcher] (http--127.0.0.1-8180-1) Failed executing GET /a.jsp: org.jboss.resteasy.spi.NotFoundException: Could not find resource for relative : /a.jsp of full path: http://localhost:8080/a.jsp
                at org.jboss.resteasy.core.registry.RootSegment.matchChildren(RootSegment.java:360) [resteasy-jaxrs-2.3.2.Final.jar:]
                at org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:374) [resteasy-jaxrs-2.3.2.Final.jar:]
                at org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:367) [resteasy-jaxrs-2.3.2.Final.jar:]
                at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:307) [resteasy-jaxrs-2.3.2.Final.jar:]
                at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:173) [resteasy-jaxrs-2.3.2.Final.jar:]
                at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:118) [resteasy-jaxrs-2.3.2.Final.jar:]
                at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]
                at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]
                at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
                at com.appia.ads.servlet.ForceRequestSchemeFilter.doFilter(ForceRequestSchemeFilter.java:78) [classes:]
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0-ea]
      

       

      Looks like as I've configured @ApplicationPath("/") so that I can deploy the application without any context, it's taking over the root context naturally and any call is going through the same.  Is there a way to do an exclusion here so that I can let /*.jsp calls and they don't have to go through REST ?

       

      Thanks

      Srikrishna Kalavacharla