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

          saikirandaripelli created issue -
          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.
          Pavel Bucek made changes -
          Field Original Value New Value
          Link This issue blocks JERSEY-927 [ JERSEY-927 ]
          Pavel Bucek made changes -
          Link This issue is duplicated by JERSEY-927 [ JERSEY-927 ]
          Pavel Bucek made changes -
          Link This issue blocks JERSEY-927 [ JERSEY-927 ]
          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
          Marek Potociar made changes -
          Component/s core [ 14364 ]
          Component/s runtime [ 10028 ]
          Martin Matula made changes -
          Assignee japod [ japod@java.net ] Jakub Podlešák [ japod ]
          Hide
          Jakub Podlesak added a comment -

          Setting fix version to 2.0

          Show
          Jakub Podlesak added a comment - Setting fix version to 2.0
          Jakub Podlesak made changes -
          Fix Version/s 2.0 [ 15271 ]
          Fix Version/s 1.0 [ 10078 ]
          Marek Potociar made changes -
          Affects Version/s not determined [ 10096 ]
          Affects Version/s current [ 10094 ]
          Marek Potociar made changes -
          Fix Version/s 2.0-unplanned [ 15288 ]
          Marek Potociar made changes -
          Fix Version/s 2.0-m07 [ 15959 ]
          Fix Version/s 2.0-unplanned [ 15288 ]
          Marek Potociar made changes -
          Original Estimate 3 hours [ 10800 ]
          Remaining Estimate 3 hours [ 10800 ]
          Michal Gajdos made changes -
          Assignee Jakub Podlesak [ japod ] Michal Gajdos [ michalgajdos ]
          Michal Gajdos made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Michal Gajdos logged work - 23/Aug/12 12:57 PM
          • Time Spent:
            5 hours
             
            <No comment>
          Michal Gajdos logged work - 24/Aug/12 12:58 PM
          • Time Spent:
            3 hours
             
            - first proposal
          Michal Gajdos made changes -
          Time Spent 5 hours [ 18000 ]
          Michal Gajdos made changes -
          Remaining Estimate 3 hours [ 10800 ] 1 hour [ 3600 ]
          Time Spent 5 hours [ 18000 ] 8 hours [ 28800 ]
          Michal Gajdos logged work - 27/Aug/12 2:44 PM
          • Time Spent:
            4 hours
             
            <No comment>
          Michal Gajdos logged work - 28/Aug/12 2:45 PM
          • Time Spent:
            5 hours
             
            <No comment>
          Michal Gajdos logged work - 29/Aug/12 11:23 AM
          • Time Spent:
            6 hours
             
            <No comment>
          Michal Gajdos made changes -
          Remaining Estimate 1 hour [ 3600 ] 0 minutes [ 0 ]
          Time Spent 8 hours [ 28800 ] 12 hours [ 43200 ]
          Michal Gajdos made changes -
          Time Spent 12 hours [ 43200 ] 17 hours [ 61200 ]
          Michal Gajdos made changes -
          Time Spent 17 hours [ 61200 ] 23 hours [ 82800 ]
          Michal Gajdos made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          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.
          Marek Potociar made changes -
          Affects Version/s not determined [ 10096 ]

            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