jersey
  1. jersey
  2. JERSEY-881

Package name resource config does not work in OSGi environment

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-m07, 2.0
    • Component/s: core
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      527

      Description

      To make a Jersey application work in OSGi environment, the package name
      resource configuration has to be replaced by the class name mechanism.
      This is quite annoying and should be fixed.

        Issue Links

          Activity

          Hide
          saikirandaripelli added a comment -

          Hi,
          I am not able to run helloworld-osgi-webapp-1.10 by changing the classNamesResource config to PackagenamesResourceConfig in Apache Felix or Equinox. I tried in jersey 1.8, 1.9 and 1.10.
          I just changed the web.xml init params to following, and followed the readme.
          I am able to run it, if it is classNamesResourceConfig as provided by default.

          <init-param>
          <param-name>com.sun.jersey.config.property.resourceConfigClass</param-name>
          <param-value>com.sun.jersey.api.core.PackagesResourceConfig</param-value>
          </init-param>
          <init-param>
          <param-name>com.sun.jersey.config.property.packages</param-name>
          <param-value>com.sun.jersey.samples.helloworld</param-value>
          </init-param>

          Show
          saikirandaripelli added a comment - Hi, I am not able to run helloworld-osgi-webapp-1.10 by changing the classNamesResource config to PackagenamesResourceConfig in Apache Felix or Equinox. I tried in jersey 1.8, 1.9 and 1.10. I just changed the web.xml init params to following, and followed the readme. I am able to run it, if it is classNamesResourceConfig as provided by default. <init-param> <param-name>com.sun.jersey.config.property.resourceConfigClass</param-name> <param-value>com.sun.jersey.api.core.PackagesResourceConfig</param-value> </init-param> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>com.sun.jersey.samples.helloworld</param-value> </init-param>
          Hide
          Jakub Podlesak added a comment -

          You should not need to change anything in the example configuration.
          The example should run as is out of the box in Apache Felix (look at the readme doc enclosed
          in the example root directory).

          This gets also automatically tested when you do mvn clean install
          using the pax-exam maven plugin.

          Could you please re-try, and suggest what from the above does not work for you?

          Show
          Jakub Podlesak added a comment - You should not need to change anything in the example configuration. The example should run as is out of the box in Apache Felix (look at the readme doc enclosed in the example root directory). This gets also automatically tested when you do mvn clean install using the pax-exam maven plugin. Could you please re-try, and suggest what from the above does not work for you?
          Hide
          saikirandaripelli added a comment -

          The example uses classNamesResourceConfig where we specify individual classnames in web.xml, but i want to use packageNamesResourceConfig where we specify package containing resources.
          I went through the Readme, and using example as-is(classNamesResourceConfig) is working fine in felix, but when i change it to use packageNamesResourceConfig it is not working.

          Show
          saikirandaripelli added a comment - The example uses classNamesResourceConfig where we specify individual classnames in web.xml, but i want to use packageNamesResourceConfig where we specify package containing resources. I went through the Readme, and using example as-is(classNamesResourceConfig) is working fine in felix, but when i change it to use packageNamesResourceConfig it is not working.
          Hide
          Pavel Bucek added a comment -

          see http://java.net/jira/browse/JERSEY-927 for steps to reproduce

          Show
          Pavel Bucek added a comment - see http://java.net/jira/browse/JERSEY-927 for steps to reproduce
          Hide
          Jakub Podlesak added a comment -

          Setting fix version to 2.0

          Show
          Jakub Podlesak added a comment - Setting fix version to 2.0
          Hide
          Michal Gajdos added a comment -

          Fixed in Jersey2. Will be migrated to Jersey1.

          Show
          Michal Gajdos added a comment - Fixed in Jersey2. Will be migrated to Jersey1.
          Hide
          Michal Gajdos added a comment -

          Migrated to Jersey 1.14.

          Show
          Michal Gajdos added a comment - Migrated to Jersey 1.14.

            People

            • Assignee:
              Michal Gajdos
              Reporter:
              saikirandaripelli
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 hours Original Estimate - 3 hours
                3h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 23 hours
                23h