jersey
  1. jersey
  2. JERSEY-714

Incorrect deployment instructions for Servlet 3.0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: docs
    • Labels:
      None

      Description

      http://jersey.java.net/nonav/documentation/latest/user-guide.html#getting-started recommends the following web.xml configuration under Servlet 3.0:

      <servlet>
      <servlet-name>org.foo.rest.MyApplication</servlet-name>
      </servlet>
      ...
      <servlet-mapping>
      <servlet-name>Jersey Web Application</servlet-name>
      <url-pattern>/resources</url-pattern>
      </servlet-mapping>

      Running this against Glassfish 3.1 gives me this error:

      "There is no web component by the name of Jersey Web Application here.. Please see server.log for more details." I believe the documentation is incorrect. There is no way for Servlet 3.0 to magically associate the servlet with the servlet-mapping without some common/linking key.

        Activity

        Hide
        jbenoit added a comment -

        Reproduced using sample jersey\tests\functional\jersey-servlet3_0-integration\preliminaryapp
        modified src\main\webapp\WEB-INF\web.xml to specify what docs recommend, i.e:
        <servlet-mapping>
        <servlet-name>Jersey Web Application</servlet-name>
        <url-pattern>/resources</url-pattern>
        </servlet-mapping>

        and with url-pattern more specific to this particular example:

        <servlet-mapping>
        <servlet-name>Jersey Web Application</servlet-name>
        <url-pattern>/oneandtwo/*</url-pattern>
        </servlet-mapping>

        and in both cases server.log shows "There is no web component by the name of Jersey Web Application here"

        If I change back to original version of this sample's web.xml file, it works:
        <servlet-mapping>
        <servlet-name>com.sun.jersey.test.functional.servlet3.preliminaryapp.OneAndTwoApplication</servlet-name>
        <url-pattern>/oneandtwo/*</url-pattern>
        </servlet-mapping>

        So change jersey\jersey-documentation>svn diff
        Index: src/docbook/OverviewOfJAX-RS.xml
        ===================================================================
        — src/docbook/OverviewOfJAX-RS.xml (revision 4900)
        +++ src/docbook/OverviewOfJAX-RS.xml (working copy)
        @@ -331,7 +331,7 @@
        </servlet>
        ...
        <servlet-mapping>

        • <servlet-name>Jersey Web Application</servlet-name>
          + <servlet-name>org.foo.rest.MyApplication</servlet-name>
          <url-pattern>/resources</url-pattern>
          </servlet-mapping>
          ...
        Show
        jbenoit added a comment - Reproduced using sample jersey\tests\functional\jersey-servlet3_0-integration\preliminaryapp modified src\main\webapp\WEB-INF\web.xml to specify what docs recommend, i.e: <servlet-mapping> <servlet-name>Jersey Web Application</servlet-name> <url-pattern>/resources</url-pattern> </servlet-mapping> and with url-pattern more specific to this particular example: <servlet-mapping> <servlet-name>Jersey Web Application</servlet-name> <url-pattern>/oneandtwo/*</url-pattern> </servlet-mapping> and in both cases server.log shows "There is no web component by the name of Jersey Web Application here" If I change back to original version of this sample's web.xml file, it works: <servlet-mapping> <servlet-name>com.sun.jersey.test.functional.servlet3.preliminaryapp.OneAndTwoApplication</servlet-name> <url-pattern>/oneandtwo/*</url-pattern> </servlet-mapping> So change jersey\jersey-documentation>svn diff Index: src/docbook/OverviewOfJAX-RS.xml =================================================================== — src/docbook/OverviewOfJAX-RS.xml (revision 4900) +++ src/docbook/OverviewOfJAX-RS.xml (working copy) @@ -331,7 +331,7 @@ </servlet> ... <servlet-mapping> <servlet-name>Jersey Web Application</servlet-name> + <servlet-name>org.foo.rest.MyApplication</servlet-name> <url-pattern>/resources</url-pattern> </servlet-mapping> ...
        Hide
        jbenoit added a comment -

        fixed
        Sending jersey\jersey-documentation\src\docbook\OverviewOfJAX-RS.xml
        Transmitting file data .
        Committed revision 4919.

        C:\jersey\jersey-documentation>svn diff
        Index: src/docbook/OverviewOfJAX-RS.xml
        ===================================================================
        — src/docbook/OverviewOfJAX-RS.xml (revision 4918)
        +++ src/docbook/OverviewOfJAX-RS.xml (working copy)
        @@ -331,7 +331,7 @@
        </servlet>
        ...
        <servlet-mapping>

        • <servlet-name>Jersey Web Application</servlet-name>
          + <servlet-name>org.foo.rest.MyApplication</servlet-name>
          <url-pattern>/resources</url-pattern>
          </servlet-mapping>
          ...
        Show
        jbenoit added a comment - fixed Sending jersey\jersey-documentation\src\docbook\OverviewOfJAX-RS.xml Transmitting file data . Committed revision 4919. C:\jersey\jersey-documentation>svn diff Index: src/docbook/OverviewOfJAX-RS.xml =================================================================== — src/docbook/OverviewOfJAX-RS.xml (revision 4918) +++ src/docbook/OverviewOfJAX-RS.xml (working copy) @@ -331,7 +331,7 @@ </servlet> ... <servlet-mapping> <servlet-name>Jersey Web Application</servlet-name> + <servlet-name>org.foo.rest.MyApplication</servlet-name> <url-pattern>/resources</url-pattern> </servlet-mapping> ...

          People

          • Assignee:
            jbenoit
            Reporter:
            cowwoc
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: