Issue Details (XML | Word | Printable)

Key: JERSEY-881
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Michal Gajdos
Reporter: saikirandaripelli
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
jersey

Package name resource config does not work in OSGi environment

Created: 12/Dec/11 06:09 AM   Updated: 08/Aug/13 11:46 AM   Resolved: 03/Sep/12 03:27 PM
Component/s: core
Affects Version/s: None
Fix Version/s: 2.0-m07, 2.0

Time Tracking:
Original Estimate: 3 hours
Original Estimate - 3 hours
Remaining Estimate: 0 minutes
Remaining Estimate - 0 minutes
Time Spent: 23 hours
Time Spent - 23 hours

Environment:

Operating System: All
Platform: All

Issue Links:
Duplicate
 

Issuezilla Id: 527
Tags:
Participants: Jakub Podlesak, Michal Gajdos, Pavel Bucek and saikirandaripelli


 Description  « Hide

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.



saikirandaripelli added a comment - 12/Dec/11 06:14 AM

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>


Jakub Podlesak added a comment - 20/Dec/11 10:55 PM

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?


saikirandaripelli added a comment - 21/Dec/11 07:31 AM

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 added a comment - 27/Jan/12 11:28 AM

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


Jakub Podlesak added a comment - 27/Mar/12 10:51 PM

Setting fix version to 2.0


Michal Gajdos added a comment - 03/Sep/12 03:32 PM

Fixed in Jersey2. Will be migrated to Jersey1.


Michal Gajdos added a comment - 04/Sep/12 01:23 PM

Migrated to Jersey 1.14.