Open steinarb opened 5 years ago
Note: I'm able to debug the failing code using remote debug against apache karaf, so I can debug if someone can tell me what to look for.
manifest.mf from bundle built with maven-bundle-plugin 3.5.1 (i.e. the bundle that works):
Manifest-Version: 1.0
Bnd-LastModified: 1562341632773
Build-Jdk: 1.8.0_212
Built-By: sb
Bundle-ManifestVersion: 2
Bundle-Name: Sample client for authservice
Bundle-SymbolicName: no.priv.bang.authservice.sampleclient
Bundle-Version: 1.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Export-Package: no.priv.bang.authservice.sampleclient.resources;uses:=
"javax.ws.rs,javax.ws.rs.core,org.jsoup.nodes,org.osgi.service.log";v
ersion="1.0.0",no.priv.bang.authservice.sampleclient;uses:="javax.ser
vlet,org.apache.shiro.realm,org.apache.shiro.session.mgt.eis,org.apac
he.shiro.web.servlet,org.glassfish.jersey.servlet,org.osgi.service.ht
tp.context,org.osgi.service.log";version="1.0.0"
Import-Package: javax.inject;version="[1.0,2)",javax.servlet;version="
[3.1,4)",javax.ws.rs;version="[2.1,3)",javax.ws.rs.core;version="[2.1
,3)",org.apache.shiro;version="[1.4,2)",org.apache.shiro.authc;versio
n="[1.4,2)",org.apache.shiro.config;version="[1.4,2)",org.apache.shir
o.realm;version="[1.4,2)",org.apache.shiro.session.mgt;version="[1.4,
2)",org.apache.shiro.session.mgt.eis;version="[1.4,2)",org.apache.shi
ro.subject;version="[1.4,2)",org.apache.shiro.web.config;version="[1.
4,2)",org.apache.shiro.web.filter.authc;version="[1.4,2)",org.apache.
shiro.web.filter.mgt;version="[1.4,2)",org.apache.shiro.web.mgt;versi
on="[1.4,2)",org.apache.shiro.web.servlet;version="[1.4,2)",org.apach
e.shiro.web.session.mgt;version="[1.4,2)",org.glassfish.jersey.intern
al.inject;version="[2.27,3)",org.glassfish.jersey.server;version="[2.
27,3)",org.glassfish.jersey.servlet;version="[2.27,3)",org.jsoup;vers
ion="[1.11,2)",org.jsoup.nodes;version="[1.11,2)",org.jsoup.select;ve
rsion="[1.11,2)",org.osgi.service.http.context;version="[1.0,2)",org.
osgi.service.log;version="[1.3,2)"
Provide-Capability: osgi.service;objectClass:List<String>="javax.servl
et.Filter",osgi.service;objectClass:List<String>="javax.servlet.Servl
et",osgi.service;objectClass:List<String>="org.osgi.service.http.cont
ext.ServletContextHelper"
Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.compo
nent)(version>=1.3.0)(!(version>=2.0.0)))",osgi.service;filter:="(obj
ectClass=org.apache.shiro.realm.Realm)";effective:=active,osgi.servic
e;filter:="(objectClass=org.apache.shiro.session.mgt.eis.SessionDAO)"
;effective:=active,osgi.service;filter:="(objectClass=org.osgi.servic
e.log.LogService)";effective:=active,osgi.ee;filter:="(&(osgi.ee=Java
SE)(version=1.8))"
Service-Component: OSGI-INF/no.priv.bang.authservice.sampleclient.Auth
serviceSampleClientServlet.xml,OSGI-INF/no.priv.bang.authservice.samp
leclient.AuthserviceSampleClientServletContextHelper.xml,OSGI-INF/no.
priv.bang.authservice.sampleclient.AuthserviceSampleClientShiroFilter
.xml
Tool: Bnd-3.5.0.201709291849
manifest.mf from bundle built with maven-bundle-plugin 4.2.0 (i.e. the bundle that fails):
Manifest-Version: 1.0
Bnd-LastModified: 1562341874560
Build-Jdk: 1.8.0_212
Built-By: sb
Bundle-ManifestVersion: 2
Bundle-Name: Sample client for authservice
Bundle-SymbolicName: no.priv.bang.authservice.sampleclient
Bundle-Version: 1.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Export-Package: no.priv.bang.authservice.sampleclient.resources;uses:=
"javax.ws.rs,javax.ws.rs.core,org.jsoup.nodes,org.osgi.service.log";v
ersion="1.0.0",no.priv.bang.authservice.sampleclient;uses:="javax.ser
vlet,org.apache.shiro.realm,org.apache.shiro.session.mgt.eis,org.apac
he.shiro.web.servlet,org.glassfish.jersey.servlet,org.osgi.service.ht
tp.context,org.osgi.service.log";version="1.0.0"
Import-Package: javax.inject,javax.servlet;version="[3.1,4)",javax.ws.
rs;version="[2.1,3)",javax.ws.rs.core;version="[2.1,3)",no.priv.bang.
authservice.sampleclient,org.apache.shiro;version="[1.4,2)",org.apach
e.shiro.authc;version="[1.4,2)",org.apache.shiro.config;version="[1.4
,2)",org.apache.shiro.realm;version="[1.4,2)",org.apache.shiro.sessio
n.mgt;version="[1.4,2)",org.apache.shiro.session.mgt.eis;version="[1.
4,2)",org.apache.shiro.subject;version="[1.4,2)",org.apache.shiro.web
.config;version="[1.4,2)",org.apache.shiro.web.filter.authc;version="
[1.4,2)",org.apache.shiro.web.filter.mgt;version="[1.4,2)",org.apache
.shiro.web.mgt;version="[1.4,2)",org.apache.shiro.web.servlet;version
="[1.4,2)",org.apache.shiro.web.session.mgt;version="[1.4,2)",org.gla
ssfish.jersey.internal.inject;version="[2.27,3)",org.glassfish.jersey
.server;version="[2.27,3)",org.glassfish.jersey.servlet;version="[2.2
7,3)",org.jsoup;version="[1.11,2)",org.jsoup.nodes;version="[1.11,2)"
,org.jsoup.select;version="[1.11,2)",org.osgi.service.http.context;ve
rsion="[1.0,2)",org.osgi.service.log;version="[1.3,2)"
Provide-Capability: osgi.service;objectClass:List<String>="javax.servl
et.Filter",osgi.service;objectClass:List<String>="javax.servlet.Servl
et",osgi.service;objectClass:List<String>="org.osgi.service.http.cont
ext.ServletContextHelper"
Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.compo
nent)(version>=1.3.0)(!(version>=2.0.0)))",osgi.service;filter:="(obj
ectClass=org.apache.shiro.realm.Realm)";effective:=active,osgi.servic
e;filter:="(objectClass=org.apache.shiro.session.mgt.eis.SessionDAO)"
;effective:=active,osgi.service;filter:="(objectClass=org.osgi.servic
e.log.LogService)";effective:=active,osgi.contract;osgi.contract=Java
Inject;filter:="(&(osgi.contract=JavaInject)(version=1.0.0))",osgi.ee
;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Service-Component: OSGI-INF/no.priv.bang.authservice.sampleclient.Auth
serviceSampleClientServlet.xml,OSGI-INF/no.priv.bang.authservice.samp
leclient.AuthserviceSampleClientServletContextHelper.xml,OSGI-INF/no.
priv.bang.authservice.sampleclient.AuthserviceSampleClientShiroFilter
.xml
Tool: Bnd-4.2.0.201903051501
Short description: I have several webapplications consisting of OSGi bundles running in apache karaf, where the REST API is provided by jersey. In the REST API bundles I set the jersey servlet up as an OSGi Declarative Services (DS). The application works when being built with maven-bundle-plugin 3.5.1 but fails when being built with maven-bundle-plugin 4.2.0.
(The reason I'm trying to upgrade maven-bundle-plugin, is that I'm in the process to moving from openjdk-8 to openjdk-11. Note: this failure happens on openjdk-8, when I've built the bundles with maven-bundle-plugin 4.2.0)
Versions of the build and execution environment:
The failing code, is the code I'm using to add OSGi services injected into the Declarative Services components, to HK2, so that they can be injected into the Jersey resources: https://github.com/steinarb/authservice-sampleclient/blob/f37d46b2f3baca87763a0b78f5afa19add8b2828/src/main/java/no/priv/bang/authservice/sampleclient/AuthserviceSampleClientServlet.java#L67
The stack trace from the failed startup, is: