jersey-2.0


Jersey Client (JAX-RS 2) not working in OSGI


I am attempting to install and use Jersey 2 in Karaf version 3.
My features.xml (provisioning) contains the following dependencies:
<bundle>mvn:javax.ws.rs/javax.ws.rs-api/2.0.1</bundle>
<bundle>mvn:org.glassfish.hk2/hk2-locator/2.3.0</bundle>
<bundle>mvn:org.glassfish.hk2/osgi-resource-locator/1.0.1</bundle>
<bundle>mvn:org.glassfish.jersey.core/jersey-common/2.12</bundle>
<bundle>mvn:org.glassfish.jersey.bundles.repackaged/jersey-guava/2.12</bundle>
<bundle>mvn:org.glassfish.hk2/hk2-utils/2.3.0</bundle>
<bundle>mvn:org.glassfish.hk2/hk2-api/2.3.0-b10</bundle>
<bundle>mvn:org.glassfish.hk2.external/javax.inject/2.3.0-b10</bundle>
<bundle>mvn:org.glassfish.jersey.core/jersey-client/2.12</bundle>
My code outside of the container posts requests successfully but on using inside the OSGI container fails when attempting to dynamically load the required javax.ws.rs.* implementing classes, as per the edited stack trace below:
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_51]
at java.lang.Class.forName0(Native Method)[:1.7.0_51]
at java.lang.Class.forName(Class.java:270)[:1.7.0_51]
at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:107)
at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:225)
The Import-Package of the manifest I am using contains the following:
com.google.common.base;version="[18.0,19)",com.google.common.collect;version="[18.0,19)",com.google.gson;version="[2.2,3)",javax.ws.rs;version="2.0,3)",javax.ws.rs.client;version="[2.0,3)",javax.ws.rs.core;version="[2.0,3)",javax.ws.rs.ext;version="[2.0,3)"
How do I bundle the jersey client or my service to avoid the problems caused, for OSGI, of the Class.forName used in the FactoryFinder.newInstance() method ?

Related Links

Jersey 2: filters and #Context injections
Cannot inject HttpServletRequest in ContainerRequestFilter via #Context jersey2.x and weblogic 12.1.3
Jersy Client gives UnkownHostException
Getting swagger-core 1.5 to work with Jersey and Grizzly
Post ArrayList of custom object in Jersey Client
Swagger 1.3.7 and Jersey 2.15/2.16 issue: the request entity is in a format not supported by the requested resource
Dropwizard 0.8.0 WADL support
Jersey(2.10.4) Entity provider selection algorithm gives less priority to custom providers(MessageBodyWriter) making it not to be invoked
HK2 What is the proper way to override bindings of another AbstractBinder
Why does jersey have no error log when the status is 500?
Generate JSON definition from jersey using swagger
Jersey Client (JAX-RS 2) not working in OSGI
Jersey returns 500 when trying to return an XML response
Bean Validation 400 errors are returning default error page (html) instead of Response entity (json)
Exception while using jersey-declarative-linking
How to use Jackson with Jersey 2.8?

Categories

HOME
apache-nifi
plesk
yaml
xcode8.1
softlayer
redmine
swi-prolog
haproxy
ews
theano
magento-2.0
tabs
portable-class-library
amp
hyperledger
javafx-8
phpmqtt
responsive-design
chromecast
tomcat8
psql
raml
libgit2
qa
function-points
unordered-multimap
spreadsheetgear
instructions
commonsware-cwac
rspec-rails
selenide
python-sounddevice
imgur
export-to-pdf
game-center
hdiv
access-denied
1wire
optionaldataexception
morphline
audio-converter
absolute
roracle
xcglogger
skip-lists
emacs25
ltrace
adobe-reader
maatwebsite-excel
yargs
rational-performance-test
msbuild-4.0
cdo.message
android-4.2-jelly-bean
piping
node.js-connect
seadragon
management-studio-express
deeplink
ibm-was
ruby-on-rails-4.1
ora-04091
wicked-gem
python-curses
createfile
directorysearcher
global-scope
treeline
webautomation
screwturn
forio-contour
cpu-time
spring-social-linkedin
infinite
insertonsubmit
axacropdf
mongo-jackson-mapper
background-thread
ntlmv2
clrprofiler
cakeyframeanimation
flymake
dropshadow
directshow.net
digiflow
turbine
bass
ninject-interception
sscli
urchin
processors
tacit-programming
twitter-feed
isapi-redirect
rendering-engine
parentid

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App