You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had searched in the issues and found no similar issues.
Environment
OSGi R8 Felix environment.
Shiro version
Version 2.0.0 of shiro-web, jakarta classifier.
What was the actual outcome?
Inside its manifest, shiro-web with jakarta classifier (as documented in https://shiro.apache.org/jakarta-ee.html) imports old javax.servlet packages instead of the newer jakarta ones.
As a result, we need to install old javax bundles just to start the shiro-web bundle, and in the end we get a very logical exception java.lang.ClassNotFoundException: jakarta.servlet.ServletContextListener not found by org.apache.shiro.web
This is logical since the code refers to jakarta.* packages, but as the manifest says to import javax.* instead jakarta packages are not seen (and we have the old packages present, but that is a lesser evil - the main issue here is that we fail).
This seems to be due to the way the shiro jakarta packages are created by using shading - the manifest does not seem to be re-written at the time. I may be wrong.
What was the expected outcome?
shiro-web bundle should start.
How to reproduce
Just try to start the bundle in any OSGi R8 container like Karaf.
Debug logs
org.osgi.framework.ServiceException: Service factory exception: jakarta/servlet/ServletContextListener
at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:354)
at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:249)
at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:362)
at org.apache.felix.framework.Felix.getService(Felix.java:3984)
at org.apache.felix.framework.BundleContextImpl$ServiceObjectsImpl.getService(BundleContextImpl.java:554)
at org.apache.felix.http.base.internal.util.ServiceUtils.safeGetServiceObjects(ServiceUtils.java:65)
at org.apache.felix.http.base.internal.runtime.AbstractInfo.getService(AbstractInfo.java:253)
at org.apache.felix.http.base.internal.handler.ListenerHandler.init(ListenerHandler.java:118)
at org.apache.felix.http.base.internal.registry.EventListenerRegistry.addListeners(EventListenerRegistry.java:95)
at org.apache.felix.http.base.internal.registry.PerContextHandlerRegistry.registerListeners(PerContextHandlerRegistry.java:257)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.registerWhiteboardService(WhiteboardManager.java:768)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.activate(WhiteboardManager.java:272)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.addContextHelper(WhiteboardManager.java:365)
at org.apache.felix.http.base.internal.whiteboard.tracker.JavaxServletContextHelperTracker.added(JavaxServletContextHelperTracker.java:108)
at org.apache.felix.http.base.internal.whiteboard.tracker.JavaxServletContextHelperTracker.addingService(JavaxServletContextHelperTracker.java:82)
at org.apache.felix.http.base.internal.whiteboard.tracker.JavaxServletContextHelperTracker.addingService(JavaxServletContextHelperTracker.java:38)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:944)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:872)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:322)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:265)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.addTracker(WhiteboardManager.java:187)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.start(WhiteboardManager.java:172)
at org.apache.felix.http.base.internal.HttpServiceController.register(HttpServiceController.java:136)
at org.apache.felix.http.jetty.internal.JettyService.initializeJetty(JettyService.java:360)
at org.apache.felix.http.jetty.internal.JettyService.startJetty(JettyService.java:174)
at org.apache.felix.http.jetty.internal.JettyService.updated(JettyService.java:166)
at org.apache.felix.http.jetty.internal.JettyManagedService.updated(JettyManagedService.java:38)
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)
at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1418)
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:122)
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:84)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NoClassDefFoundError: jakarta/servlet/ServletContextListener
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2338)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClassParallel(BundleWiringImpl.java:2156)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2090)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)
at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1358)
at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1612)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1528)
at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2338)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClassParallel(BundleWiringImpl.java:2156)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2090)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)
at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:2116)
at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:986)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.initDependencyManagers(AbstractComponentManager.java:1027)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractComponentManager.java:1057)
at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:955)
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:920)
at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:349)
... 35 common frames omitted
Caused by: java.lang.ClassNotFoundException: jakarta.servlet.ServletContextListener not found by org.apache.shiro.web [106]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1591)
at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
... 66 common frames omitted
Search before asking
Environment
OSGi R8 Felix environment.
Shiro version
Version 2.0.0 of shiro-web, jakarta classifier.
What was the actual outcome?
Inside its manifest,
shiro-web
with jakarta classifier (as documented in https://shiro.apache.org/jakarta-ee.html) imports old javax.servlet packages instead of the newer jakarta ones.As a result, we need to install old javax bundles just to start the shiro-web bundle, and in the end we get a very logical exception
java.lang.ClassNotFoundException: jakarta.servlet.ServletContextListener not found by org.apache.shiro.web
This is logical since the code refers to
jakarta.*
packages, but as the manifest says to importjavax.*
instead jakarta packages are not seen (and we have the old packages present, but that is a lesser evil - the main issue here is that we fail).This seems to be due to the way the shiro jakarta packages are created by using shading - the manifest does not seem to be re-written at the time. I may be wrong.
What was the expected outcome?
shiro-web bundle should start.
How to reproduce
Just try to start the bundle in any OSGi R8 container like Karaf.
Debug logs
Manifest of the bundle :
The text was updated successfully, but these errors were encountered: