jax-rs-spec
  1. jax-rs-spec
  2. JAX_RS_SPEC-331

JAX-RS application Failed to load and run, when using myApp extending jersey Application class.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: model api, server
    • Labels:
      None
    • Environment:

      Windows 7 Professional SP1.
      GlassFish 4_b69

      Description

      When I was testing the section 2.3.2 Servlet for the first part which dictates:

      • If the Application subclass is annotated with @ApplicationPath, implementations are REQUIRED to use the value of this annotation appended with "/*" to define a mapping for the added server.

      The following JAX-RS2 app bellow was failed to be registered and run by the Glassfish v4_b69, while it runs on Glassfish 3.2.1.1, by raising the following info message [failed to localize] jersey.app.registered.mapping(eg.taman.jcp.specs.rs2.test.app.MyApplication, /res/*)|#]" which it should be error not info message also.

      The same if I added my custom application into the web.xml deployment descriptor.

      Full error:

      [#|2013-01-05T02:18:11.925+0200|INFO|glassfish4.0|org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer|_ThreadID=33;_ThreadName=admin-listener(1);_TimeMillis=1357345091925;_LevelValue=800;|[failed to localize] jersey.app.registered.mapping(eg.taman.jcp.specs.rs2.test.app.MyApplication, /res/*)|#]

      [#|2013-01-05T02:18:11.964+0200|INFO|glassfish4.0|javax.enterprise.web|_ThreadID=33;_ThreadName=admin-listener(1);_TimeMillis=1357345091964;_LevelValue=800;_MessageID=AS-WEB-00324;|Loading application [JAX-RS_v2.0_Test] at [/rs2/test]|#]

      Application Details:
      --------------------------

      My Custom Application

      package eg.taman.jcp.specs.rs2.test.app;

      import javax.ws.rs.ApplicationPath;
      import javax.ws.rs.core.Application;

      /**

      • User: mohamed_taman
      • Date: 1/5/13
      • Time: 2:02 AM
      • My Custom Application Configuration.
        */
        @ApplicationPath("res")
        public class MyApplication extends Application {
        }

      Resource Class

      package eg.taman.jcp.specs.rs2.test.app;

      import javax.ws.rs.GET;
      import javax.ws.rs.Path;
      import javax.ws.rs.Produces;

      /**

      • User: mohamed_taman
      • Date: 1/4/13
      • Time: 11:44 PM
      • This class intended to test that there is no application sub class exists and the jax-rs 2 implementation should serve this
      • resource, by adding in the web.xml the Application class and its servlet mappings.
        */

      @Path("hello")
      public class GreeterResource {

      @GET
      @Produces("text/plain")
      public String greeting()

      { return "Hello world"; }

      }

      web.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <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_3_0.xsd"
      version="3.0">
      <servlet>
      <servlet-name>eg.taman.jcp.specs.rs2.test.app.MyApplication</servlet-name>
      </servlet>
      <servlet-mapping>
      <servlet-name>eg.taman.jcp.specs.rs2.test.app.MyApplication</servlet-name>
      <url-pattern>/res/*</url-pattern>
      </servlet-mapping>
      </web-app>

        Activity

        Hide
        Santiago Pericas-Geertsen added a comment -

        This is not an issue on the JAX-RS specification but on the RI (Jersey). It should be filed at jersey.java.net.

        Show
        Santiago Pericas-Geertsen added a comment - This is not an issue on the JAX-RS specification but on the RI (Jersey). It should be filed at jersey.java.net.

          People

          • Assignee:
            Unassigned
            Reporter:
            Mohamed Taman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: