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

Cumulocity support for Jersey client 2.x
How to get a list of loaded truststores for a given SSLContext?
Advanced use of the Jersey resource model: variable annotation for entity
how to know if my grizzly http server is enabled for multiple threads?
Jersey 2.0 Services beanValidationHelper
Mailgun Jersey 2X receive email #Consumes(What?)
delegate HTTP request to Jersey
jersey2 unable to return response object
how do I log a Jersey2 Http request?
Does StreamingOutput in Jersey need to close?
Handling Client Timeout in Jersey 2
Jersey 2 with Jackson1 Feature and Joda DateTime unproper json format
migrate to Jersey 2.x with fastinfoset
How can I force UriBuilder to use https?
Jersey 2: filters and #Context injections
Cannot inject HttpServletRequest in ContainerRequestFilter via #Context jersey2.x and weblogic 12.1.3

Categories

HOME
gaming
mpdf
cucumber
eclipse-plugin
transactions
initialization
web2py
iptables
drag-and-drop
haxe
stored-procedures
save
u-boot
jpa-criteria
msmq
match
vimeo
business-intelligence
sql-injection
sonicwall
multiple-tables
infrared
angular2-highcharts
akka-persistence
pyopencl
tortoisemerge
crud
math.js
microprocessors
openbr
docx4j
intune
commonsware-cwac
listjs
payeezy
cmis
runtimeexception
mv
django-smart-selects
android-n
rdp
reset
python-sounddevice
classnotfoundexception
icepdf
linq-to-excel
django-static-precompiler
non-linear-regression
head.js
iptv
asp.net-web-api-routing
mongodb-aggregation
emf-compare
fitbit
deviare
tablespace
gnucash
noclassdeffounderror
android-async-http
gravatar
jsr363
univocity
wikimedia-commons
whitespace-language
quercus
fuseesb
r.java-file
adhoc-polymorphism
dnsjava
utf8-decode
device-admin
nesper
igor
otl
mfmessagecomposeview
rails-api
eclim
progress-db
ember-table
jacob
html-frames
arel
multiple-dispatch
nsmutablestring
nsfont
algol68
mkannotation
wiktionary
n-queens
zend-server-ce
differentiation
glassfish-esb
nsconnection
django-pagination
eaccelerator
principles
mysqli-multi-query
source-code-protection

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App