Discussion:
Felix/Grizzly/Jersey
David Tkaczyk
2009-12-27 20:27:56 UTC
Permalink
Hi,



I'm really struggling (going on 2 or 3 days now) to get Felix to work with a

Grizzly Http Service deploying Jersey. I've googled like crazy to

try and resolve on my own, but no luck. I'm hoping that I'm overlooking

something simple that someone can point out to me. Everything is

ACTIVE/RESOLVED from an osgi perspective. My problem appears to be that

Jersey cannot locate my resource file. Along with Jersey's inability to

find my resource class there's also a stack trace (ServiceConfigurationError)

that I'll post below. Also, I've posted this on the felix site as well, but

haven't received any help.



Thanks,

Dave



package camiant.osgi.msr.rest;



import java.util.Dictionary;

import java.util.Hashtable;

import org.osgi.framework.ServiceReference;

import org.osgi.service.http.HttpService;

import org.osgi.util.tracker.ServiceTrackerCustomizer;

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

import com.sun.jersey.server.impl.container.servlet.ServletAdaptor;



public class HttpServiceServiceTrackerCustomizer implements

ServiceTrackerCustomizer {



private static final Logger LOGGER =

LoggerFactory.getLogger(HttpServiceServiceTrackerCustomizer.class);



private static final Dictionary<String, String> JERSEY_INIT_PARAMS = new

Hashtable<String, String>();



static {

// NOTE: I've tried several different ways to get Jersey to find my

resource file, but no luck. package config/resource config/custom

Application

// Just about every different way that Jersey allows, I've

tried



JERSEY_INIT_PARAMS.put("com.sun.jersey.config.property.packages",

"camiant.osgi.msr.rest.resource");

}



@Override

public Object addingService(ServiceReference serviceRef) {



LOGGER.info("Adding service: " +

serviceRef.getBundle().getSymbolicName());



HttpService grizzlyService =

(HttpService)serviceRef.getBundle().getBundleContext().getService(serviceRef

);



try {

// NOTE: as you see I've tried both ServletContainer and

ServletAdaptor - both produce similar results



//grizzlyService.registerServlet("/rs", new ServletContainer(),

JERSEY_INIT_PARAMS, null);



grizzlyService.registerServlet("/rs", new ServletAdaptor(),

JERSEY_INIT_PARAMS, null);

} catch (Exception e) {

e.printStackTrace(); //TODO what is best here..

grizzlyService = null;

}



return grizzlyService;

}

}



package camiant.osgi.msr.rest.resource;



import javax.ws.rs.GET;

import javax.ws.rs.Path;

import javax.ws.rs.Produces;

import javax.ws.rs.core.Response;



@Path("/msr")

public class TestResource {



@GET

@Path("/keytypes")

@Produces("text/xml")

public Response getKeyTypes() {

return Response.ok().entity("this is a cheap key type!!!!!!!!!").build();

}

}



Welcome to Felix

================



2009-12-23 16:30:47,872-0500 INFO RestMSRCoreServiceTrackerCustomizer:16 -

Adding service: camiant.osgi.msr.core



Dec 23, 2009 4:30:48 PM com.sun.grizzly.Controller logVersion



INFO: Starting Grizzly Framework 1.9.18-e - Wed Dec 23 16:30:48 EST 2009



2009-12-23 16:30:48,220-0500 INFO HttpServiceServiceTrackerCustomizer:65 -

Adding service: com.sun.grizzly.osgi.grizzly-httpservice-bundle



Dec 23, 2009 4:30:48 PM com.sun.jersey.api.core.PackagesResourceConfig init



INFO: Scanning for root resource and provider classes in the packages:

camiant.osgi.msr.rest.resource



Dec 23, 2009 4:30:48 PM com.sun.jersey.api.core.ScanningResourceConfig init

INFO: No root resource classes found.

Dec 23, 2009 4:30:48 PM com.sun.jersey.api.core.ScanningResourceConfig init

INFO: No provider classes found.



ERROR: EventDispatcher: Error during dispatch.

(com.sun.jersey.spi.service.ServiceConfigurationError:

com.sun.jersey.spi.container.WebApplicationProvider: The class

com.sun.jersey.server.impl.container.WebApplicationProviderImpl implementing

provider interface com.sun.jersey.spi.container.WebApplicationProvider could

not be instantiated: null)



com.sun.jersey.spi.service.ServiceConfigurationError:

com.sun.jersey.spi.container.WebApplicationProvider: The class

com.sun.jersey.server.impl.container.WebApplicationProviderImpl implementing

provider interface com.sun.jersey.spi.container.WebApplicationProvider could

not be instantiated: null



at

com.sun.jersey.spi.service.ServiceFinder.fail(ServiceFinder.java:380)

at

com.sun.jersey.spi.service.ServiceFinder.access$600(ServiceFinder.java:144)

at

com.sun.jersey.spi.service.ServiceFinder$LazyObjectIterator.hasNext(ServiceF

inder.java:683)

at

com.sun.jersey.spi.container.WebApplicationFactory.createWebApplication(WebA

pplicationFactory.java:61)

at

com.sun.jersey.spi.container.servlet.ServletContainer.create(ServletContaine

r.java:325)

at

com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.c

reate(ServletContainer.java:240)

at

com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:548

)

at

com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:201

)

at

com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.

java:307)

at

com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.

java:470)

at javax.servlet.GenericServlet.init(GenericServlet.java:242)

at

com.sun.grizzly.http.servlet.ServletAdapter.loadServlet(ServletAdapter.java:

428)

at

com.sun.grizzly.osgi.httpservice.OSGiServletAdapter.startServlet(OSGiServlet

Adapter.java:99)

at

com.sun.grizzly.osgi.httpservice.OSGiMainAdapter.registerServletAdapter(OSGi

MainAdapter.java:178)

at

com.sun.grizzly.osgi.httpservice.HttpServiceImpl.registerServlet(HttpService

Impl.java:92)

at

camiant.osgi.msr.rest.HttpServiceServiceTrackerCustomizer.addingService(Http

ServiceServiceTrackerCustomizer.java:70)

at

org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker

.java:896)

at

org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)

at

org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:233)

at

org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.j

ava:840)

at

org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallbac

k(EventDispatcher.java:878)

at

org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDi

spatcher.java:732)

at

org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispat

cher.java:662)

at

org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3587)

at org.apache.felix.framework.Felix.access$000(Felix.java:40)

at

org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:625)

at

org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.j

ava:90)

at

org.apache.felix.framework.Felix.registerService(Felix.java:2711)

at

org.apache.felix.framework.BundleContextImpl.registerService(BundleContextIm

pl.java:252)

at

org.apache.felix.framework.BundleContextImpl.registerService(BundleContextIm

pl.java:230)

at

com.sun.grizzly.osgi.httpservice.Activator.start(Activator.java:89)

at

org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.jav

a:639)

at

org.apache.felix.framework.Felix.activateBundle(Felix.java:1700)

at org.apache.felix.framework.Felix.startBundle(Felix.java:1622)

at

org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1077)

at

org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)

at java.lang.Thread.run(Thread.java:619)

Caused by: java.lang.ClassCastException

at java.lang.Class.cast(Class.java:2990)

at

com.sun.jersey.spi.service.ServiceFinder$LazyObjectIterator.hasNext(ServiceF

inder.java:641)



... 34 more



[INFO] Started bridged http service

ps



START LEVEL 1



ID State Level Name

[ 0] [Active ] [ 0] System Bundle (2.0.1)

[ 1] [Active ] [ 1] Ant repackaging (3.0.0.b74b)

[ 2] [Active ] [ 1] ASM all classes (3.2)

[ 3] [Active ] [ 1] Camiant MSR Core (0.1.0)

[ 4] [Active ] [ 1] Camiant MSR REST (0.1.0)

[ 5] [Active ] [ 1] Grizzly OSGi HttpService Bundle (1.9.18.e)

[ 6] [Active ] [ 1] http (0)

[ 7] [Active ] [ 1] Jackson JSON processor (1.1.1)

[ 8] [Active ] [ 1] javax.annotation API v.1.1 (3.0.0.b74b)

[ 9] [Active ] [ 1] javax.ejb API v.3.1 (3.0.0.b74b)

[ 10] [Active ] [ 1] Java Persistence API 2.0 (2.0.0.v200911271158)

[ 11] [Active ] [ 1] javax.servlet API v.3.0 (3.0.0.b74b)

[ 12] [Active ] [ 1] javax.servlet.jsp API v.2.1.2 (3.0.0.b74b)

[ 13] [Active ] [ 1] jaxb-api (2.2)

[ 14] [Active ] [ 1] jaxb (2.2)

[ 15] [Active ] [ 1] jdom (0)

[ 16] [Active ] [ 1] jersey-bundle (1.1.5.ea-SNAPSHOT)

[ 17] [Active ] [ 1] jettison (1.1)

[ 18] [Active ] [ 1] jsr311-api (1.1.1)

[ 19] [Active ] [ 1] JavaMail API (1.4.3)

[ 20] [Active ] [ 1] Apache Felix Configuration Admin Service

(1.2.4)

[ 21] [Active ] [ 1] Apache Felix Http Bundle (2.0.4)

[ 22] [Active ] [ 1] Apache Felix Shell Service (1.4.1)

[ 23] [Active ] [ 1] Apache Felix Shell TUI (1.4.1)

[ 24] [Active ] [ 1] Apache Felix Web Management Console (2.0.2)

[ 25] [Resolved ] [ 1] Camiant MSR Log4JProperties (0.5.0)

[ 26] [Active ] [ 1] Apache Jakarta log4j Plug-in

(1.2.15.v200910021404)

[ 27] [Active ] [ 1] ROME, RSS and atOM utilitiEs for Java (1.0)

[ 28] [Active ] [ 1] slf4j-api (1.5.8)

[ 29] [Resolved ] [ 1] slf4j-log4j12 (1.5.8)

[ 30] [Active ] [ 1] Sun Misc RT Packages (1.0.0)

[ 31] [Active ] [ 1] tools (0)

[ 32] [Active ] [ 1] Weld OSGi Bundle (1.0.0.SP4)




David Tkaczyk
Member of Technical Staff

[cid:image001.gif-***@public.gmane.org]<http://www.fiercewireless.com/special-reports/camiant-top-wireless-company-2009-fiercewireless-fierce-15>

www.camiant.com<http://www.camiant.com>
200 Nickerson Road, Marlborough, MA 01752-4603 USA

[cid:image002.gif-***@public.gmane.org]<http://twitter.com/camiant>
Paul Sandoz
2009-12-29 10:42:30 UTC
Permalink
Hi David,

Jakub, who is currently on holiday, is working on OSGi integration.
There is a branch:

branches/jersey-osgi-fication/jersey

where some good progress has been made. Perhaps you can check out that
branch and have a look?

We would like to have such support ready for Jersey 1.1.5 (scheduled
for middle of Jan) but i think we may require some help with testing
because we want to ensure we get this correct.

There are some issues still left to resolve but we are getting close.
IIRC the main issue is one of scanning for resource and provider
classes, and instead a Jersey application bundle needs to explicitly
register such classes via an implementation of
javax.ws.rs.core.Application.


The main issue with Jersey integration is that Jersey utilizes META-
INF/services files [*] and we need a way of integrating support that
is OSGi friendly.

Paul.

[*] META-INF/services files are a very poor choice for dynamic modules!
Post by David Tkaczyk
Hi,
I'm really struggling (going on 2 or 3 days now) to get Felix to work with a
Grizzly Http Service deploying Jersey. I've googled like crazy to
try and resolve on my own, but no luck. I'm hoping that I'm
overlooking
something simple that someone can point out to me. Everything is
ACTIVE/RESOLVED from an osgi perspective. My problem appears to be that
Jersey cannot locate my resource file. Along with Jersey's
inability to
find my resource class there's also a stack trace
(ServiceConfigurationError)
that I'll post below. Also, I’ve posted this on the felix site as
well, but
haven’t received any help.
Thanks,
Dave
package camiant.osgi.msr.rest;
import java.util.Dictionary;
import java.util.Hashtable;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sun.jersey.server.impl.container.servlet.ServletAdaptor;
public class HttpServiceServiceTrackerCustomizer implements
ServiceTrackerCustomizer {
private static final Logger LOGGER =
LoggerFactory.getLogger(HttpServiceServiceTrackerCustomizer.class);
private static final Dictionary<String, String> JERSEY_INIT_PARAMS = new
Hashtable<String, String>();
static {
// NOTE: I've tried several different ways to get Jersey to find my
resource file, but no luck. package config/resource config/custom
Application
// Just about every different way that Jersey
allows, I've
tried
JERSEY_INIT_PARAMS.put("com.sun.jersey.config.property.packages",
"camiant.osgi.msr.rest.resource");
}
@Override
public Object addingService(ServiceReference serviceRef) {
LOGGER.info("Adding service: " +
serviceRef.getBundle().getSymbolicName());
HttpService grizzlyService =
(HttpService
)serviceRef.getBundle().getBundleContext().getService(serviceRef
);
try {
// NOTE: as you see I've tried both ServletContainer and
ServletAdaptor - both produce similar results
//grizzlyService.registerServlet("/rs", new ServletContainer(),
JERSEY_INIT_PARAMS, null);
grizzlyService.registerServlet("/rs", new ServletAdaptor(),
JERSEY_INIT_PARAMS, null);
} catch (Exception e) {
e.printStackTrace(); //TODO what is best here..
grizzlyService = null;
}
return grizzlyService;
}
}
package camiant.osgi.msr.rest.resource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
@Path("/msr")
public class TestResource {
@GET
@Path("/keytypes")
@Produces("text/xml")
public Response getKeyTypes() {
return Response.ok().entity("this is a cheap key
type!!!!!!!!!").build();
}
}
Welcome to Felix
================
2009-12-23 16:30:47,872-0500 INFO
RestMSRCoreServiceTrackerCustomizer:16 -
Adding service: camiant.osgi.msr.core
Dec 23, 2009 4:30:48 PM com.sun.grizzly.Controller logVersion
INFO: Starting Grizzly Framework 1.9.18-e - Wed Dec 23 16:30:48 EST 2009
2009-12-23 16:30:48,220-0500 INFO
HttpServiceServiceTrackerCustomizer:65 -
Adding service: com.sun.grizzly.osgi.grizzly-httpservice-bundle
Dec 23, 2009 4:30:48 PM
com.sun.jersey.api.core.PackagesResourceConfig init
camiant.osgi.msr.rest.resource
Dec 23, 2009 4:30:48 PM
com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No root resource classes found.
Dec 23, 2009 4:30:48 PM
com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
ERROR: EventDispatcher: Error during dispatch.
com.sun.jersey.spi.container.WebApplicationProvider: The class
com.sun.jersey.server.impl.container.WebApplicationProviderImpl implementing
provider interface
com.sun.jersey.spi.container.WebApplicationProvider could
not be instantiated: null)
com.sun.jersey.spi.container.WebApplicationProvider: The class
com.sun.jersey.server.impl.container.WebApplicationProviderImpl implementing
provider interface
com.sun.jersey.spi.container.WebApplicationProvider could
not be instantiated: null
at
com.sun.jersey.spi.service.ServiceFinder.fail(ServiceFinder.java:380)
at
com.sun.jersey.spi.service.ServiceFinder.access
$600(ServiceFinder.java:144)
at
com.sun.jersey.spi.service.ServiceFinder
$LazyObjectIterator.hasNext(ServiceF
inder.java:683)
at
com
.sun
.jersey.spi.container.WebApplicationFactory.createWebApplication(WebA
pplicationFactory.java:61)
at
com
.sun
.jersey.spi.container.servlet.ServletContainer.create(ServletContaine
r.java:325)
at
com.sun.jersey.spi.container.servlet.ServletContainer
$InternalWebComponent.c
reate(ServletContainer.java:240)
at
com
.sun
.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:548
)
at
com
.sun
.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:201
)
at
com
.sun
.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.
java:307)
at
com
.sun
.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.
java:470)
242)
at
com
.sun
428)
at
com
.sun
.grizzly.osgi.httpservice.OSGiServletAdapter.startServlet(OSGiServlet
Adapter.java:99)
at
com
.sun
.grizzly.osgi.httpservice.OSGiMainAdapter.registerServletAdapter(OSGi
MainAdapter.java:178)
at
com
.sun
.grizzly.osgi.httpservice.HttpServiceImpl.registerServlet(HttpService
Impl.java:92)
at
camiant
.osgi.msr.rest.HttpServiceServiceTrackerCustomizer.addingService(Http
ServiceServiceTrackerCustomizer.java:70)
at
org.osgi.util.tracker.ServiceTracker
$Tracked.customizerAdding(ServiceTracker
.java:896)
at
org
261)
at
org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:233)
at
org.osgi.util.tracker.ServiceTracker
$Tracked.serviceChanged(ServiceTracker.j
ava:840)
at
org
.apache
.felix.framework.util.EventDispatcher.invokeServiceListenerCallbac
k(EventDispatcher.java:878)
at
org
.apache
.felix.framework.util.EventDispatcher.fireEventImmediately(EventDi
spatcher.java:732)
at
org
.apache
.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispat
cher.java:662)
at
org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3587)
at org.apache.felix.framework.Felix.access
$000(Felix.java:40)
at
org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:625)
at
org
.apache
.felix.framework.ServiceRegistry.registerService(ServiceRegistry.j
ava:90)
at
org.apache.felix.framework.Felix.registerService(Felix.java:2711)
at
org
.apache
.felix.framework.BundleContextImpl.registerService(BundleContextIm
pl.java:252)
at
org
.apache
.felix.framework.BundleContextImpl.registerService(BundleContextIm
pl.java:230)
at
com.sun.grizzly.osgi.httpservice.Activator.start(Activator.java:89)
at
org
.apache
.felix.framework.util.SecureAction.startActivator(SecureAction.jav
a:639)
at
org.apache.felix.framework.Felix.activateBundle(Felix.java:1700)
at
org.apache.felix.framework.Felix.startBundle(Felix.java:1622)
at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1077)
at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990)
at
com.sun.jersey.spi.service.ServiceFinder
$LazyObjectIterator.hasNext(ServiceF
inder.java:641)
... 34 more
[INFO] Started bridged http service
ps
START LEVEL 1
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (2.0.1)
[ 1] [Active ] [ 1] Ant repackaging (3.0.0.b74b)
[ 2] [Active ] [ 1] ASM all classes (3.2)
[ 3] [Active ] [ 1] Camiant MSR Core (0.1.0)
[ 4] [Active ] [ 1] Camiant MSR REST (0.1.0)
[ 5] [Active ] [ 1] Grizzly OSGi HttpService Bundle
(1.9.18.e)
[ 6] [Active ] [ 1] http (0)
[ 7] [Active ] [ 1] Jackson JSON processor (1.1.1)
[ 8] [Active ] [ 1] javax.annotation API v.1.1 (3.0.0.b74b)
[ 9] [Active ] [ 1] javax.ejb API v.3.1 (3.0.0.b74b)
[ 10] [Active ] [ 1] Java Persistence API 2.0
(2.0.0.v200911271158)
[ 11] [Active ] [ 1] javax.servlet API v.3.0 (3.0.0.b74b)
[ 12] [Active ] [ 1] javax.servlet.jsp API v.2.1.2
(3.0.0.b74b)
[ 13] [Active ] [ 1] jaxb-api (2.2)
[ 14] [Active ] [ 1] jaxb (2.2)
[ 15] [Active ] [ 1] jdom (0)
[ 16] [Active ] [ 1] jersey-bundle (1.1.5.ea-SNAPSHOT)
[ 17] [Active ] [ 1] jettison (1.1)
[ 18] [Active ] [ 1] jsr311-api (1.1.1)
[ 19] [Active ] [ 1] JavaMail API (1.4.3)
[ 20] [Active ] [ 1] Apache Felix Configuration Admin Service
(1.2.4)
[ 21] [Active ] [ 1] Apache Felix Http Bundle (2.0.4)
[ 22] [Active ] [ 1] Apache Felix Shell Service (1.4.1)
[ 23] [Active ] [ 1] Apache Felix Shell TUI (1.4.1)
[ 24] [Active ] [ 1] Apache Felix Web Management Console (2.0.2)
[ 25] [Resolved ] [ 1] Camiant MSR Log4JProperties (0.5.0)
[ 26] [Active ] [ 1] Apache Jakarta log4j Plug-in
(1.2.15.v200910021404)
[ 27] [Active ] [ 1] ROME, RSS and atOM utilitiEs for Java (1.0)
[ 28] [Active ] [ 1] slf4j-api (1.5.8)
[ 29] [Resolved ] [ 1] slf4j-log4j12 (1.5.8)
[ 30] [Active ] [ 1] Sun Misc RT Packages (1.0.0)
[ 31] [Active ] [ 1] tools (0)
[ 32] [Active ] [ 1] Weld OSGi Bundle (1.0.0.SP4)
David Tkaczyk
Member of Technical Staff
<image001.gif>
www.camiant.com
200 Nickerson Road, Marlborough, MA 01752-4603 USA
<image002.gif>
Paul Sandoz
2010-01-05 14:05:01 UTC
Permalink
Post by Paul Sandoz
Hi David,
Jakub, who is currently on holiday, is working on OSGi integration.=
=20
Post by Paul Sandoz
branches/jersey-osgi-fication/jersey
Wrong branch, it is

branches/jersey-osgi-fication

To build and test you need to use SE 6.

Paul.
Post by Paul Sandoz
where some good progress has been made. Perhaps you can check out =
=20
Post by Paul Sandoz
that branch and have a look?
We would like to have such support ready for Jersey 1.1.5 (schedule=
d =20
Post by Paul Sandoz
for middle of Jan) but i think we may require some help with testin=
g =20
Post by Paul Sandoz
because we want to ensure we get this correct.
There are some issues still left to resolve but we are getting =
=20
Post by Paul Sandoz
close. IIRC the main issue is one of scanning for resource and =
=20
Post by Paul Sandoz
provider classes, and instead a Jersey application bundle needs to =
=20
Post by Paul Sandoz
explicitly register such classes via an implementation of =20
javax.ws.rs.core.Application.
The main issue with Jersey integration is that Jersey utilizes META=
-=20
Post by Paul Sandoz
INF/services files [*] and we need a way of integrating support tha=
t =20
Post by Paul Sandoz
is OSGi friendly.
Paul.
[*] META-INF/services files are a very poor choice for dynamic =
=20
Post by Paul Sandoz
modules!
Hi,
I'm really struggling (going on 2 or 3 days now) to get Felix to =
=20
Post by Paul Sandoz
work with a
Grizzly Http Service deploying Jersey. I've googled like crazy to
try and resolve on my own, but no luck. I'm hoping that I'm =20
overlooking
something simple that someone can point out to me. Everything is
ACTIVE/RESOLVED from an osgi perspective. My problem appears to b=
e =20
Post by Paul Sandoz
that
Jersey cannot locate my resource file. Along with Jersey's =20
inability to
find my resource class there's also a stack trace =20
(ServiceConfigurationError)
that I'll post below. Also, I=92ve posted this on the felix site =
as =20
Post by Paul Sandoz
well, but
haven=92t received any help.
Thanks,
Dave
package camiant.osgi.msr.rest;
import java.util.Dictionary;
import java.util.Hashtable;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sun.jersey.server.impl.container.servlet.ServletAdaptor=
;
Post by Paul Sandoz
public class HttpServiceServiceTrackerCustomizer implements
ServiceTrackerCustomizer {
private static final Logger LOGGER =3D
LoggerFactory.getLogger(HttpServiceServiceTrackerCustomizer.class)=
;
Post by Paul Sandoz
private static final Dictionary<String, String> =20
JERSEY_INIT_PARAMS =3D new
Hashtable<String, String>();
static {
// NOTE: I've tried several different ways to get Jersey to =
=20
Post by Paul Sandoz
find my
resource file, but no luck. package config/resource config/custom
Application
// Just about every different way that Jersey =
=20
Post by Paul Sandoz
allows, I've
tried
JERSEY_INIT_PARAMS.put("com.sun.jersey.config.property.package=
s",
Post by Paul Sandoz
"camiant.osgi.msr.rest.resource");
}
@Override
public Object addingService(ServiceReference serviceRef) {
LOGGER.info("Adding service: " +
serviceRef.getBundle().getSymbolicName());
HttpService grizzlyService =3D
(HttpService=20
)serviceRef.getBundle().getBundleContext().getService(serviceRef
);
try {
// NOTE: as you see I've tried both ServletContainer and
ServletAdaptor - both produce similar results
//grizzlyService.registerServlet("/rs", new ServletContainer=
(),
Post by Paul Sandoz
JERSEY_INIT_PARAMS, null);
grizzlyService.registerServlet("/rs", new ServletAdaptor(),
JERSEY_INIT_PARAMS, null);
} catch (Exception e) {
e.printStackTrace(); //TODO what is best here..
grizzlyService =3D null;
}
return grizzlyService;
}
}
package camiant.osgi.msr.rest.resource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
@Path("/msr")
public class TestResource {
@GET
@Path("/keytypes")
@Produces("text/xml")
public Response getKeyTypes() {
return Response.ok().entity("this is a cheap key =20
type!!!!!!!!!").build();
}
}
Welcome to Felix
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
2009-12-23 16:30:47,872-0500 INFO =20
RestMSRCoreServiceTrackerCustomizer:16 -
Adding service: camiant.osgi.msr.core
Dec 23, 2009 4:30:48 PM com.sun.grizzly.Controller logVersion
INFO: Starting Grizzly Framework 1.9.18-e - Wed Dec 23 16:30:48 ES=
T =20
Post by Paul Sandoz
2009
2009-12-23 16:30:48,220-0500 INFO =20
HttpServiceServiceTrackerCustomizer:65 -
Adding service: com.sun.grizzly.osgi.grizzly-httpservice-bundle
Dec 23, 2009 4:30:48 PM =20
com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the =20
camiant.osgi.msr.rest.resource
Dec 23, 2009 4:30:48 PM =20
com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No root resource classes found.
Dec 23, 2009 4:30:48 PM =20
com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
ERROR: EventDispatcher: Error during dispatch.
com.sun.jersey.spi.container.WebApplicationProvider: The class
com.sun.jersey.server.impl.container.WebApplicationProviderImpl =
=20
Post by Paul Sandoz
implementing
provider interface =20
com.sun.jersey.spi.container.WebApplicationProvider could
not be instantiated: null)
com.sun.jersey.spi.container.WebApplicationProvider: The class
com.sun.jersey.server.impl.container.WebApplicationProviderImpl =
=20
Post by Paul Sandoz
implementing
provider interface =20
com.sun.jersey.spi.container.WebApplicationProvider could
not be instantiated: null
at
com.sun.jersey.spi.service.ServiceFinder.fail(ServiceFinder.java:3=
80)
Post by Paul Sandoz
at
com.sun.jersey.spi.service.ServiceFinder.access=20
$600(ServiceFinder.java:144)
at
com.sun.jersey.spi.service.ServiceFinder=20
$LazyObjectIterator.hasNext(ServiceF
inder.java:683)
at
com=20
.sun=20
.jersey.spi.container.WebApplicationFactory.createWebApplication(W=
ebA
Post by Paul Sandoz
pplicationFactory.java:61)
at
com=20
.sun=20
.jersey.spi.container.servlet.ServletContainer.create(ServletConta=
ine
Post by Paul Sandoz
r.java:325)
at
com.sun.jersey.spi.container.servlet.ServletContainer=20
$InternalWebComponent.c
reate(ServletContainer.java:240)
at
com=20
.sun=20
.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:=
548
Post by Paul Sandoz
)
at
com=20
.sun=20
.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:=
201
Post by Paul Sandoz
)
at
com=20
.sun=20
.jersey.spi.container.servlet.ServletContainer.init(ServletContain=
er.
Post by Paul Sandoz
java:307)
at
com=20
.sun=20
.jersey.spi.container.servlet.ServletContainer.init(ServletContain=
er.
Post by Paul Sandoz
java:470)
at =20
javax.servlet.GenericServlet.init(GenericServlet.java:242)
at
com=20
.sun=20
.grizzly.http.servlet.ServletAdapter.loadServlet(ServletAdapter.ja=
428)
at
com=20
.sun=20
.grizzly.osgi.httpservice.OSGiServletAdapter.startServlet(OSGiServ=
let
Post by Paul Sandoz
Adapter.java:99)
at
com=20
.sun=20
.grizzly.osgi.httpservice.OSGiMainAdapter.registerServletAdapter(O=
SGi
Post by Paul Sandoz
MainAdapter.java:178)
at
com=20
.sun=20
.grizzly.osgi.httpservice.HttpServiceImpl.registerServlet(HttpServ=
ice
Post by Paul Sandoz
Impl.java:92)
at
camiant=20
.osgi.msr.rest.HttpServiceServiceTrackerCustomizer.addingService(H=
ttp
Post by Paul Sandoz
ServiceServiceTrackerCustomizer.java:70)
at
org.osgi.util.tracker.ServiceTracker=20
$Tracked.customizerAdding(ServiceTracker
.java:896)
at
org=20
.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.jav=
a:=20
Post by Paul Sandoz
261)
at
org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:2=
33)
Post by Paul Sandoz
at
org.osgi.util.tracker.ServiceTracker=20
$Tracked.serviceChanged(ServiceTracker.j
ava:840)
at
org=20
.apache=20
.felix.framework.util.EventDispatcher.invokeServiceListenerCallbac
k(EventDispatcher.java:878)
at
org=20
.apache=20
.felix.framework.util.EventDispatcher.fireEventImmediately(EventDi
spatcher.java:732)
at
org=20
.apache=20
.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispat
cher.java:662)
at
org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3587)
at org.apache.felix.framework.Felix.access=20
$000(Felix.java:40)
at
org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:625)
at
org=20
.apache=20
.felix.framework.ServiceRegistry.registerService(ServiceRegistry.j
ava:90)
at
org.apache.felix.framework.Felix.registerService(Felix.java:2711)
at
org=20
.apache=20
.felix.framework.BundleContextImpl.registerService(BundleContextIm
pl.java:252)
at
org=20
.apache=20
.felix.framework.BundleContextImpl.registerService(BundleContextIm
pl.java:230)
at
com.sun.grizzly.osgi.httpservice.Activator.start(Activator.java:89=
)
Post by Paul Sandoz
at
org=20
.apache=20
.felix.framework.util.SecureAction.startActivator(SecureAction.jav
a:639)
at
org.apache.felix.framework.Felix.activateBundle(Felix.java:1700)
at =20
org.apache.felix.framework.Felix.startBundle(Felix.java:1622)
at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:10=
77)
Post by Paul Sandoz
at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:=
=20
Post by Paul Sandoz
264)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990)
at
com.sun.jersey.spi.service.ServiceFinder=20
$LazyObjectIterator.hasNext(ServiceF
inder.java:641)
... 34 more
[INFO] Started bridged http service
ps
START LEVEL 1
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (2.0.1)
[ 1] [Active ] [ 1] Ant repackaging (3.0.0.b74b)
[ 2] [Active ] [ 1] ASM all classes (3.2)
[ 3] [Active ] [ 1] Camiant MSR Core (0.1.0)
[ 4] [Active ] [ 1] Camiant MSR REST (0.1.0)
[ 5] [Active ] [ 1] Grizzly OSGi HttpService Bundle =20
(1.9.18.e)
[ 6] [Active ] [ 1] http (0)
[ 7] [Active ] [ 1] Jackson JSON processor (1.1.1)
[ 8] [Active ] [ 1] javax.annotation API v.1.1 (3.0.0.b74=
b)
Post by Paul Sandoz
[ 9] [Active ] [ 1] javax.ejb API v.3.1 (3.0.0.b74b)
[ 10] [Active ] [ 1] Java Persistence API 2.0 =20
(2.0.0.v200911271158)
[ 11] [Active ] [ 1] javax.servlet API v.3.0 (3.0.0.b74b)
[ 12] [Active ] [ 1] javax.servlet.jsp API v.2.1.2 =20
(3.0.0.b74b)
[ 13] [Active ] [ 1] jaxb-api (2.2)
[ 14] [Active ] [ 1] jaxb (2.2)
[ 15] [Active ] [ 1] jdom (0)
[ 16] [Active ] [ 1] jersey-bundle (1.1.5.ea-SNAPSHOT)
[ 17] [Active ] [ 1] jettison (1.1)
[ 18] [Active ] [ 1] jsr311-api (1.1.1)
[ 19] [Active ] [ 1] JavaMail API (1.4.3)
[ 20] [Active ] [ 1] Apache Felix Configuration Admin Serv=
ice
Post by Paul Sandoz
(1.2.4)
[ 21] [Active ] [ 1] Apache Felix Http Bundle (2.0.4)
[ 22] [Active ] [ 1] Apache Felix Shell Service (1.4.1)
[ 23] [Active ] [ 1] Apache Felix Shell TUI (1.4.1)
[ 24] [Active ] [ 1] Apache Felix Web Management Console =
=20
Post by Paul Sandoz
(2.0.2)
[ 25] [Resolved ] [ 1] Camiant MSR Log4JProperties (0.5.0)
[ 26] [Active ] [ 1] Apache Jakarta log4j Plug-in
(1.2.15.v200910021404)
[ 27] [Active ] [ 1] ROME, RSS and atOM utilitiEs for Java=
=20
Post by Paul Sandoz
(1.0)
[ 28] [Active ] [ 1] slf4j-api (1.5.8)
[ 29] [Resolved ] [ 1] slf4j-log4j12 (1.5.8)
[ 30] [Active ] [ 1] Sun Misc RT Packages (1.0.0)
[ 31] [Active ] [ 1] tools (0)
[ 32] [Active ] [ 1] Weld OSGi Bundle (1.0.0.SP4)
David Tkaczyk
Member of Technical Staff
<image001.gif>
www.camiant.com
200 Nickerson Road, Marlborough, MA 01752-4603 USA
<image002.gif>
Jakub Podlesak
2010-01-05 14:54:23 UTC
Permalink
Post by Paul Sandoz
Post by Paul Sandoz
Hi David,
Jakub, who is currently on holiday, is working on OSGi integration.
branches/jersey-osgi-fication/jersey
no, it is: branches/jersey-servicemix

i am sorry for not responding earlier. After fixing some minor issues,
i am going to merge the osgi stuff to the main trunk, so that people
could give it a test drive.

~Jakub
Post by Paul Sandoz
Wrong branch, it is
branches/jersey-osgi-fication
To build and test you need to use SE 6.
Paul.
Post by Paul Sandoz
where some good progress has been made. Perhaps you can check out
that branch and have a look?
We would like to have such support ready for Jersey 1.1.5 (scheduled
for middle of Jan) but i think we may require some help with testing
because we want to ensure we get this correct.
There are some issues still left to resolve but we are getting
close. IIRC the main issue is one of scanning for resource and
provider classes, and instead a Jersey application bundle needs to
explicitly register such classes via an implementation of
javax.ws.rs.core.Application.
The main issue with Jersey integration is that Jersey utilizes META-
INF/services files [*] and we need a way of integrating support that
is OSGi friendly.
Paul.
[*] META-INF/services files are a very poor choice for dynamic modules!
Post by David Tkaczyk
Hi,
I'm really struggling (going on 2 or 3 days now) to get Felix to work with a
Grizzly Http Service deploying Jersey. I've googled like crazy to
try and resolve on my own, but no luck. I'm hoping that I'm
overlooking
something simple that someone can point out to me. Everything is
ACTIVE/RESOLVED from an osgi perspective. My problem appears to be that
Jersey cannot locate my resource file. Along with Jersey's
inability to
find my resource class there's also a stack trace
(ServiceConfigurationError)
that I'll post below. Also, I’ve posted this on the felix site as
well, but
haven’t received any help.
Thanks,
Dave
package camiant.osgi.msr.rest;
import java.util.Dictionary;
import java.util.Hashtable;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sun.jersey.server.impl.container.servlet.ServletAdaptor;
public class HttpServiceServiceTrackerCustomizer implements
ServiceTrackerCustomizer {
private static final Logger LOGGER =
LoggerFactory.getLogger(HttpServiceServiceTrackerCustomizer.class);
private static final Dictionary<String, String>
JERSEY_INIT_PARAMS = new
Hashtable<String, String>();
static {
// NOTE: I've tried several different ways to get Jersey to find my
resource file, but no luck. package config/resource config/custom
Application
// Just about every different way that Jersey allows, I've
tried
JERSEY_INIT_PARAMS.put("com.sun.jersey.config.property.packages",
"camiant.osgi.msr.rest.resource");
}
@Override
public Object addingService(ServiceReference serviceRef) {
LOGGER.info("Adding service: " +
serviceRef.getBundle().getSymbolicName());
HttpService grizzlyService =
(HttpService
)serviceRef.getBundle().getBundleContext().getService(serviceRef
);
try {
// NOTE: as you see I've tried both ServletContainer and
ServletAdaptor - both produce similar results
//grizzlyService.registerServlet("/rs", new ServletContainer(),
JERSEY_INIT_PARAMS, null);
grizzlyService.registerServlet("/rs", new ServletAdaptor(),
JERSEY_INIT_PARAMS, null);
} catch (Exception e) {
e.printStackTrace(); //TODO what is best here..
grizzlyService = null;
}
return grizzlyService;
}
}
package camiant.osgi.msr.rest.resource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
@Path("/msr")
public class TestResource {
@GET
@Path("/keytypes")
@Produces("text/xml")
public Response getKeyTypes() {
return Response.ok().entity("this is a cheap key
type!!!!!!!!!").build();
}
}
Welcome to Felix
================
2009-12-23 16:30:47,872-0500 INFO
RestMSRCoreServiceTrackerCustomizer:16 -
Adding service: camiant.osgi.msr.core
Dec 23, 2009 4:30:48 PM com.sun.grizzly.Controller logVersion
INFO: Starting Grizzly Framework 1.9.18-e - Wed Dec 23 16:30:48 EST 2009
2009-12-23 16:30:48,220-0500 INFO
HttpServiceServiceTrackerCustomizer:65 -
Adding service: com.sun.grizzly.osgi.grizzly-httpservice-bundle
Dec 23, 2009 4:30:48 PM
com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the
camiant.osgi.msr.rest.resource
Dec 23, 2009 4:30:48 PM
com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No root resource classes found.
Dec 23, 2009 4:30:48 PM
com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
ERROR: EventDispatcher: Error during dispatch.
com.sun.jersey.spi.container.WebApplicationProvider: The class
com.sun.jersey.server.impl.container.WebApplicationProviderImpl implementing
provider interface
com.sun.jersey.spi.container.WebApplicationProvider could
not be instantiated: null)
com.sun.jersey.spi.container.WebApplicationProvider: The class
com.sun.jersey.server.impl.container.WebApplicationProviderImpl implementing
provider interface
com.sun.jersey.spi.container.WebApplicationProvider could
not be instantiated: null
at
com.sun.jersey.spi.service.ServiceFinder.fail(ServiceFinder.java:380)
at
com.sun.jersey.spi.service.ServiceFinder.access
$600(ServiceFinder.java:144)
at
com.sun.jersey.spi.service.ServiceFinder
$LazyObjectIterator.hasNext(ServiceF
inder.java:683)
at
com
.sun
.jersey.spi.container.WebApplicationFactory.createWebApplication(WebA
pplicationFactory.java:61)
at
com
.sun
.jersey.spi.container.servlet.ServletContainer.create(ServletContaine
r.java:325)
at
com.sun.jersey.spi.container.servlet.ServletContainer
$InternalWebComponent.c
reate(ServletContainer.java:240)
at
com
.sun
.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:548
)
at
com
.sun
.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:201
)
at
com
.sun
.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.
java:307)
at
com
.sun
.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.
java:470)
at
javax.servlet.GenericServlet.init(GenericServlet.java:242)
at
com
.sun
428)
at
com
.sun
.grizzly.osgi.httpservice.OSGiServletAdapter.startServlet(OSGiServlet
Adapter.java:99)
at
com
.sun
.grizzly.osgi.httpservice.OSGiMainAdapter.registerServletAdapter(OSGi
MainAdapter.java:178)
at
com
.sun
.grizzly.osgi.httpservice.HttpServiceImpl.registerServlet(HttpService
Impl.java:92)
at
camiant
.osgi.msr.rest.HttpServiceServiceTrackerCustomizer.addingService(Http
ServiceServiceTrackerCustomizer.java:70)
at
org.osgi.util.tracker.ServiceTracker
$Tracked.customizerAdding(ServiceTracker
.java:896)
at
org
261)
at
org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:233)
at
org.osgi.util.tracker.ServiceTracker
$Tracked.serviceChanged(ServiceTracker.j
ava:840)
at
org
.apache
.felix.framework.util.EventDispatcher.invokeServiceListenerCallbac
k(EventDispatcher.java:878)
at
org
.apache
.felix.framework.util.EventDispatcher.fireEventImmediately(EventDi
spatcher.java:732)
at
org
.apache
.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispat
cher.java:662)
at
org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3587)
at org.apache.felix.framework.Felix.access
$000(Felix.java:40)
at
org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:625)
at
org
.apache
.felix.framework.ServiceRegistry.registerService(ServiceRegistry.j
ava:90)
at
org.apache.felix.framework.Felix.registerService(Felix.java:2711)
at
org
.apache
.felix.framework.BundleContextImpl.registerService(BundleContextIm
pl.java:252)
at
org
.apache
.felix.framework.BundleContextImpl.registerService(BundleContextIm
pl.java:230)
at
com.sun.grizzly.osgi.httpservice.Activator.start(Activator.java:89)
at
org
.apache
.felix.framework.util.SecureAction.startActivator(SecureAction.jav
a:639)
at
org.apache.felix.framework.Felix.activateBundle(Felix.java:1700)
at
org.apache.felix.framework.Felix.startBundle(Felix.java:1622)
at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1077)
at
264)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990)
at
com.sun.jersey.spi.service.ServiceFinder
$LazyObjectIterator.hasNext(ServiceF
inder.java:641)
... 34 more
[INFO] Started bridged http service
ps
START LEVEL 1
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (2.0.1)
[ 1] [Active ] [ 1] Ant repackaging (3.0.0.b74b)
[ 2] [Active ] [ 1] ASM all classes (3.2)
[ 3] [Active ] [ 1] Camiant MSR Core (0.1.0)
[ 4] [Active ] [ 1] Camiant MSR REST (0.1.0)
[ 5] [Active ] [ 1] Grizzly OSGi HttpService Bundle
(1.9.18.e)
[ 6] [Active ] [ 1] http (0)
[ 7] [Active ] [ 1] Jackson JSON processor (1.1.1)
[ 8] [Active ] [ 1] javax.annotation API v.1.1 (3.0.0.b74b)
[ 9] [Active ] [ 1] javax.ejb API v.3.1 (3.0.0.b74b)
[ 10] [Active ] [ 1] Java Persistence API 2.0
(2.0.0.v200911271158)
[ 11] [Active ] [ 1] javax.servlet API v.3.0 (3.0.0.b74b)
[ 12] [Active ] [ 1] javax.servlet.jsp API v.2.1.2
(3.0.0.b74b)
[ 13] [Active ] [ 1] jaxb-api (2.2)
[ 14] [Active ] [ 1] jaxb (2.2)
[ 15] [Active ] [ 1] jdom (0)
[ 16] [Active ] [ 1] jersey-bundle (1.1.5.ea-SNAPSHOT)
[ 17] [Active ] [ 1] jettison (1.1)
[ 18] [Active ] [ 1] jsr311-api (1.1.1)
[ 19] [Active ] [ 1] JavaMail API (1.4.3)
[ 20] [Active ] [ 1] Apache Felix Configuration Admin Service
(1.2.4)
[ 21] [Active ] [ 1] Apache Felix Http Bundle (2.0.4)
[ 22] [Active ] [ 1] Apache Felix Shell Service (1.4.1)
[ 23] [Active ] [ 1] Apache Felix Shell TUI (1.4.1)
[ 24] [Active ] [ 1] Apache Felix Web Management Console (2.0.2)
[ 25] [Resolved ] [ 1] Camiant MSR Log4JProperties (0.5.0)
[ 26] [Active ] [ 1] Apache Jakarta log4j Plug-in
(1.2.15.v200910021404)
[ 27] [Active ] [ 1] ROME, RSS and atOM utilitiEs for Java (1.0)
[ 28] [Active ] [ 1] slf4j-api (1.5.8)
[ 29] [Resolved ] [ 1] slf4j-log4j12 (1.5.8)
[ 30] [Active ] [ 1] Sun Misc RT Packages (1.0.0)
[ 31] [Active ] [ 1] tools (0)
[ 32] [Active ] [ 1] Weld OSGi Bundle (1.0.0.SP4)
David Tkaczyk
Member of Technical Staff
<image001.gif>
www.camiant.com
200 Nickerson Road, Marlborough, MA 01752-4603 USA
<image002.gif>
---------------------------------------------------------------------
--
http://blogs.sun.com/japod
Paul Sandoz
2010-01-05 14:57:45 UTC
Permalink
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Hi David,
Jakub, who is currently on holiday, is working on OSGi integratio=
n.
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
branches/jersey-osgi-fication/jersey
no, it is: branches/jersey-servicemix
Doh! thanks for correcting me, a terrible copy and paste error!

Paul.
Post by Jakub Podlesak
i am sorry for not responding earlier. After fixing some minor issu=
es,
Post by Jakub Podlesak
i am going to merge the osgi stuff to the main trunk, so that peopl=
e
Post by Jakub Podlesak
could give it a test drive.
~Jakub
Post by Paul Sandoz
Wrong branch, it is
branches/jersey-osgi-fication
To build and test you need to use SE 6.
Paul.
Post by Paul Sandoz
where some good progress has been made. Perhaps you can check out
that branch and have a look?
We would like to have such support ready for Jersey 1.1.5 (schedu=
led
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
for middle of Jan) but i think we may require some help with test=
ing
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
because we want to ensure we get this correct.
There are some issues still left to resolve but we are getting
close. IIRC the main issue is one of scanning for resource and
provider classes, and instead a Jersey application bundle needs t=
o
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
explicitly register such classes via an implementation of
javax.ws.rs.core.Application.
The main issue with Jersey integration is that Jersey utilizes ME=
TA-
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
INF/services files [*] and we need a way of integrating support t=
hat
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
is OSGi friendly.
Paul.
[*] META-INF/services files are a very poor choice for dynamic modules!
Post by David Tkaczyk
Hi,
I'm really struggling (going on 2 or 3 days now) to get Felix to work with a
Grizzly Http Service deploying Jersey. I've googled like crazy =
to
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
try and resolve on my own, but no luck. I'm hoping that I'm overlooking
something simple that someone can point out to me. Everything i=
s
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
ACTIVE/RESOLVED from an osgi perspective. My problem appears to=
be
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
that
Jersey cannot locate my resource file. Along with Jersey's
inability to
find my resource class there's also a stack trace
(ServiceConfigurationError)
that I'll post below. Also, I=92ve posted this on the felix sit=
e as
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
well, but
haven=92t received any help.
Thanks,
Dave
package camiant.osgi.msr.rest;
import java.util.Dictionary;
import java.util.Hashtable;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sun.jersey.server.impl.container.servlet.ServletAdapt=
or;
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
public class HttpServiceServiceTrackerCustomizer implements
ServiceTrackerCustomizer {
private static final Logger LOGGER =3D
LoggerFactory.getLogger(HttpServiceServiceTrackerCustomizer.clas=
s);
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
private static final Dictionary<String, String>
JERSEY_INIT_PARAMS =3D new
Hashtable<String, String>();
static {
// NOTE: I've tried several different ways to get Jersey to find my
resource file, but no luck. package config/resource config/custo=
m
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
Application
// Just about every different way that Jersey allows, I've
tried
JERSEY_INIT_PARAMS.put("com.sun.jersey.config.property.package=
s",
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
"camiant.osgi.msr.rest.resource");
}
@Override
public Object addingService(ServiceReference serviceRef) {
LOGGER.info("Adding service: " +
serviceRef.getBundle().getSymbolicName());
HttpService grizzlyService =3D
(HttpService
)serviceRef.getBundle().getBundleContext().getService(serviceRef
);
try {
// NOTE: as you see I've tried both ServletContainer and
ServletAdaptor - both produce similar results
//grizzlyService.registerServlet("/rs", new ServletContainer=
(),
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
JERSEY_INIT_PARAMS, null);
grizzlyService.registerServlet("/rs", new ServletAdaptor(),
JERSEY_INIT_PARAMS, null);
} catch (Exception e) {
e.printStackTrace(); //TODO what is best here..
grizzlyService =3D null;
}
return grizzlyService;
}
}
package camiant.osgi.msr.rest.resource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
@Path("/msr")
public class TestResource {
@GET
@Path("/keytypes")
@Produces("text/xml")
public Response getKeyTypes() {
return Response.ok().entity("this is a cheap key
type!!!!!!!!!").build();
}
}
Welcome to Felix
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
2009-12-23 16:30:47,872-0500 INFO
RestMSRCoreServiceTrackerCustomizer:16 -
Adding service: camiant.osgi.msr.core
Dec 23, 2009 4:30:48 PM com.sun.grizzly.Controller logVersion
INFO: Starting Grizzly Framework 1.9.18-e - Wed Dec 23 16:30:48 =
EST
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
2009
2009-12-23 16:30:48,220-0500 INFO
HttpServiceServiceTrackerCustomizer:65 -
Adding service: com.sun.grizzly.osgi.grizzly-httpservice-bundle
Dec 23, 2009 4:30:48 PM
com.sun.jersey.api.core.PackagesResourceConfig init
camiant.osgi.msr.rest.resource
Dec 23, 2009 4:30:48 PM
com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No root resource classes found.
Dec 23, 2009 4:30:48 PM
com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
ERROR: EventDispatcher: Error during dispatch.
com.sun.jersey.spi.container.WebApplicationProvider: The class
com.sun.jersey.server.impl.container.WebApplicationProviderImpl implementing
provider interface
com.sun.jersey.spi.container.WebApplicationProvider could
not be instantiated: null)
com.sun.jersey.spi.container.WebApplicationProvider: The class
com.sun.jersey.server.impl.container.WebApplicationProviderImpl implementing
provider interface
com.sun.jersey.spi.container.WebApplicationProvider could
not be instantiated: null
at
com.sun.jersey.spi.service.ServiceFinder.fail(ServiceFinder.java=
:=20
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
380)
at
com.sun.jersey.spi.service.ServiceFinder.access
$600(ServiceFinder.java:144)
at
com.sun.jersey.spi.service.ServiceFinder
$LazyObjectIterator.hasNext(ServiceF
inder.java:683)
at
com
.sun
.jersey=20
.spi.container.WebApplicationFactory.createWebApplication(WebA
pplicationFactory.java:61)
at
com
.sun
.jersey=20
.spi.container.servlet.ServletContainer.create(ServletContaine
r.java:325)
at
com.sun.jersey.spi.container.servlet.ServletContainer
$InternalWebComponent.c
reate(ServletContainer.java:240)
at
com
.sun
.jersey.spi.container.servlet.WebComponent.load(WebComponent.jav=
a:=20
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
548
)
at
com
.sun
.jersey.spi.container.servlet.WebComponent.init(WebComponent.jav=
a:=20
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
201
)
at
com
.sun
.jersey=20
.spi.container.servlet.ServletContainer.init(ServletContainer.
java:307)
at
com
.sun
.jersey=20
.spi.container.servlet.ServletContainer.init(ServletContainer.
java:470)
at
javax.servlet.GenericServlet.init(GenericServlet.java:242)
at
com
.sun
.grizzly=20
428)
at
com
.sun
.grizzly=20
.osgi.httpservice.OSGiServletAdapter.startServlet(OSGiServlet
Adapter.java:99)
at
com
.sun
.grizzly=20
.osgi.httpservice.OSGiMainAdapter.registerServletAdapter(OSGi
MainAdapter.java:178)
at
com
.sun
.grizzly=20
.osgi.httpservice.HttpServiceImpl.registerServlet(HttpService
Impl.java:92)
at
camiant
.osgi=20
.msr.rest.HttpServiceServiceTrackerCustomizer.addingService(Http
ServiceServiceTrackerCustomizer.java:70)
at
org.osgi.util.tracker.ServiceTracker
$Tracked.customizerAdding(ServiceTracker
.java:896)
at
org
.osgi=20
261)
at
org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java=
:=20
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
233)
at
org.osgi.util.tracker.ServiceTracker
$Tracked.serviceChanged(ServiceTracker.j
ava:840)
at
org
.apache
.felix.framework.util.EventDispatcher.invokeServiceListenerCallb=
ac
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
k(EventDispatcher.java:878)
at
org
.apache
.felix.framework.util.EventDispatcher.fireEventImmediately(Event=
Di
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
spatcher.java:732)
at
org
.apache
.felix.framework.util.EventDispatcher.fireServiceEvent(EventDisp=
at
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
cher.java:662)
at
org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:358=
7)
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
at org.apache.felix.framework.Felix.access
$000(Felix.java:40)
at
org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:625=
)
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
at
org
.apache
.felix.framework.ServiceRegistry.registerService(ServiceRegistry=
.j
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
ava:90)
at
org.apache.felix.framework.Felix.registerService(Felix.java:2711=
)
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
at
org
.apache
.felix.framework.BundleContextImpl.registerService(BundleContext=
Im
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
pl.java:252)
at
org
.apache
.felix.framework.BundleContextImpl.registerService(BundleContext=
Im
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
pl.java:230)
at
com.sun.grizzly.osgi.httpservice.Activator.start(Activator.java:=
89)
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
at
org
.apache
.felix.framework.util.SecureAction.startActivator(SecureAction.j=
av
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
a:639)
at
org.apache.felix.framework.Felix.activateBundle(Felix.java:1700)
at
org.apache.felix.framework.Felix.startBundle(Felix.java:1622)
at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:=
=20
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
1077)
at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.jav=
264)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990)
at
com.sun.jersey.spi.service.ServiceFinder
$LazyObjectIterator.hasNext(ServiceF
inder.java:641)
... 34 more
[INFO] Started bridged http service
ps
START LEVEL 1
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (2.0.1)
[ 1] [Active ] [ 1] Ant repackaging (3.0.0.b74b)
[ 2] [Active ] [ 1] ASM all classes (3.2)
[ 3] [Active ] [ 1] Camiant MSR Core (0.1.0)
[ 4] [Active ] [ 1] Camiant MSR REST (0.1.0)
[ 5] [Active ] [ 1] Grizzly OSGi HttpService Bundle (1.9.18.e)
[ 6] [Active ] [ 1] http (0)
[ 7] [Active ] [ 1] Jackson JSON processor (1.1.1)
[ 8] [Active ] [ 1] javax.annotation API v.1.1 =20
(3.0.0.b74b)
[ 9] [Active ] [ 1] javax.ejb API v.3.1 (3.0.0.b74b)
[ 10] [Active ] [ 1] Java Persistence API 2.0
(2.0.0.v200911271158)
[ 11] [Active ] [ 1] javax.servlet API v.3.0 (3.0.0.b74b=
)
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
[ 12] [Active ] [ 1] javax.servlet.jsp API v.2.1.2
(3.0.0.b74b)
[ 13] [Active ] [ 1] jaxb-api (2.2)
[ 14] [Active ] [ 1] jaxb (2.2)
[ 15] [Active ] [ 1] jdom (0)
[ 16] [Active ] [ 1] jersey-bundle (1.1.5.ea-SNAPSHOT)
[ 17] [Active ] [ 1] jettison (1.1)
[ 18] [Active ] [ 1] jsr311-api (1.1.1)
[ 19] [Active ] [ 1] JavaMail API (1.4.3)
[ 20] [Active ] [ 1] Apache Felix Configuration Admin =
=20
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
Service
(1.2.4)
[ 21] [Active ] [ 1] Apache Felix Http Bundle (2.0.4)
[ 22] [Active ] [ 1] Apache Felix Shell Service (1.4.1)
[ 23] [Active ] [ 1] Apache Felix Shell TUI (1.4.1)
[ 24] [Active ] [ 1] Apache Felix Web Management Console (2.0.2)
[ 25] [Resolved ] [ 1] Camiant MSR Log4JProperties (0.5.0)
[ 26] [Active ] [ 1] Apache Jakarta log4j Plug-in
(1.2.15.v200910021404)
[ 27] [Active ] [ 1] ROME, RSS and atOM utilitiEs for Ja=
va
Post by Jakub Podlesak
Post by Paul Sandoz
Post by Paul Sandoz
Post by David Tkaczyk
(1.0)
[ 28] [Active ] [ 1] slf4j-api (1.5.8)
[ 29] [Resolved ] [ 1] slf4j-log4j12 (1.5.8)
[ 30] [Active ] [ 1] Sun Misc RT Packages (1.0.0)
[ 31] [Active ] [ 1] tools (0)
[ 32] [Active ] [ 1] Weld OSGi Bundle (1.0.0.SP4)
David Tkaczyk
Member of Technical Staff
<image001.gif>
www.camiant.com
200 Nickerson Road, Marlborough, MA 01752-4603 USA
<image002.gif>
------------------------------------------------------------------=
---
Post by Jakub Podlesak
--=20
http://blogs.sun.com/japod
-------------------------------------------------------------------=
--
sunels
2011-12-21 09:34:26 UTC
Permalink
I am facing the same error on the equinox osgi .
I have two osgi bundle and they are both using jersey.
The problem is that only one of them(which is invoked first) is working and
other is getting this error always.

A class loaded by a different class loader causes this error but which class
and how ?

Note : Using jersey 1.8 here

HTTP ERROR 500

Problem accessing /application.wadl. Reason:

com.sun.jersey.spi.container.WebApplicationProvider: The class
com.sun.jersey.server.impl.container.WebApplicationProviderImpl implementing
provider interface com.sun.jersey.spi.container.WebApplicationProvider could
not be instantiated: null

Caused by:

com.sun.jersey.spi.service.ServiceConfigurationError:
com.sun.jersey.spi.container.WebApplicationProvider: The class
com.sun.jersey.server.impl.container.WebApplicationProviderImpl implementing
provider interface com.sun.jersey.spi.container.WebApplicationProvider could
not be instantiated: null
at com.sun.jersey.spi.service.ServiceFinder.fail(ServiceFinder.java:602)
at
com.sun.jersey.spi.service.ServiceFinder.access$800(ServiceFinder.java:159)
at
com.sun.jersey.spi.service.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:892)
at
com.sun.jersey.spi.container.WebApplicationFactory.createWebApplication(WebApplicationFactory.java:64)
at
com.sun.jersey.spi.container.servlet.ServletContainer.create(ServletContainer.java:391)
at
com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.create(ServletContainer.java:306)
at
com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:607)
at
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
at
org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:322)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.oksijen.sdf.threadmanager.task.RegularTask.run(RegularTask.java:54)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at
com.oksijen.sdf.threadmanager.pool.helper.SdfThread.run(SdfThread.java:28)
Caused by: java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990)
at
com.sun.jersey.spi.service.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:851)
... 31 more

Caused by:

java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990)
at
com.sun.jersey.spi.service.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:851)
at
com.sun.jersey.spi.container.WebApplicationFactory.createWebApplication(WebApplicationFactory.java:64)
at
com.sun.jersey.spi.container.servlet.ServletContainer.create(ServletContainer.java:391)
at
com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.create(ServletContainer.java:306)
at
com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:607)
at
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
at
org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:322)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.oksijen.sdf.threadmanager.task.RegularTask.run(RegularTask.java:54)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at
com.oksijen.sdf.threadmanager.pool.helper.SdfThread.run(SdfThread.java:28)

Powered by Jetty://




If i invoke the same url again error is getting like below (I guess
somethings cached inside jersey)
HTTP ERROR 500

Problem accessing /application.wadl. Reason:

ClassCastException: attempting to
castbundleresource://69.fwk8573456:7/javax/ws/rs/ext/RuntimeDelegate.classtobundleresource://96.fwk8573456:27/javax/ws/rs/ext/RuntimeDelegate.class

Caused by:

java.lang.LinkageError: ClassCastException: attempting to
castbundleresource://69.fwk8573456:7/javax/ws/rs/ext/RuntimeDelegate.classtobundleresource://96.fwk8573456:27/javax/ws/rs/ext/RuntimeDelegate.class
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:116)
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69)
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:80)
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:99)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:662)
at
com.oksijen.sdf.enabler.webservice.rest.SdfServletContainer.service(SdfServletContainer.java:20)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:322)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.oksijen.sdf.threadmanager.task.RegularTask.run(RegularTask.java:54)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at
com.oksijen.sdf.threadmanager.pool.helper.SdfThread.run(SdfThread.java:28)


--
View this message in context: http://jersey.576304.n2.nabble.com/Felix-Grizzly-Jersey-tp4224471p7114607.html
Sent from the Jersey mailing list archive at Nabble.com.

Loading...