Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RegisterServlet throws error on test, but not locally #542

Open
kharybdys opened this issue Aug 7, 2020 · 1 comment
Open

RegisterServlet throws error on test, but not locally #542

kharybdys opened this issue Aug 7, 2020 · 1 comment
Labels
0 - Backlog New issue, unvetted. bug Something isn't working

Comments

@kharybdys
Copy link
Contributor

I've recently added a Servlet including configuration to the com.sportlink.fifa.connect bundle (the one that requires Java 11).
On test it's throwing the following error:

Registration skipped for [ServletWebElement{mapping=DefaultServletMapping{httpContextId=null,urlPatterns=null,initParams={},servlet=com.dexels.sportlink.fifa.connect.FifaConnectStatusServlet@d129290, alias=/fifaconnect, servletNamefifaconnect}}] due to error during registration

With stacktrace:

java.lang.NullPointerException
  	at org.apache.xbean.finder.BundleAssignableClassFinder.toASMStylePackageName(BundleAssignableClassFinder.java:257)
  	at org.apache.xbean.finder.BundleAssignableClassFinder.isClassAcceptable(BundleAssignableClassFinder.java:111)
  	at org.apache.xbean.osgi.bundle.util.BundleClassFinder.scanZip(BundleClassFinder.java:280)
  	at org.apache.xbean.osgi.bundle.util.BundleClassFinder.scanBundleClassPath(BundleClassFinder.java:237)
  	at org.apache.xbean.osgi.bundle.util.BundleClassFinder.find(BundleClassFinder.java:112)
  	at org.ops4j.pax.web.utils.ServletContainerInitializerScanner.scanBundles(ServletContainerInitializerScanner.java:118)
  	at org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper.addContext(JettyServerWrapper.java:293)
  	at org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper.getOrCreateContext(JettyServerWrapper.java:218)
  	at org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper.getOrCreateContext(JettyServerWrapper.java:199)
  	at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.addServlet(JettyServerImpl.java:389)
  	at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Started.addServlet(ServerControllerImpl.java:316)
  	at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.addServlet(ServerControllerImpl.java:121)
  	at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:250)
  	at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:226)
  	at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:210)
  	at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:69)
  	at org.ops4j.pax.web.extender.whiteboard.internal.element.ServletWebElement.register(ServletWebElement.java:97)[118:org.ops4j.pax.web.pax-web-extender-whiteboard:7.3.5]
  	at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerWebElement(WebApplication.java:392)[118:org.ops4j.pax.web.pax-web-extender-whiteboard:7.3.5]
  	at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.addWebElement(WebApplication.java:188)[118:org.ops4j.pax.web.pax-web-extender-whiteboard:7.3.5]
  	at org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.addingService(AbstractTracker.java:191)[118:org.ops4j.pax.web.pax-web-extender-whiteboard:7.3.5]
  	at org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.addingService(AbstractTracker.java:44)[118:org.ops4j.pax.web.pax-web-extender-whiteboard:7.3.5]
  	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943)[felix.jar:]
  	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:871)[felix.jar:]
  	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[felix.jar:]
  	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[felix.jar:]
  	at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:903)[felix.jar:]
  	at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)[felix.jar:]
  	at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)[felix.jar:]
  	at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)[felix.jar:]
  	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4833)[felix.jar:]
  	at org.apache.felix.framework.Felix.registerService(Felix.java:3804)[felix.jar:]
  	at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328)[felix.jar:]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:907)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:893)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:128)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:960)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:733)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.DependencyManager$SingleDynamicCustomizer.addedService(DependencyManager.java:852)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.DependencyManager$SingleDynamicCustomizer.addedService(DependencyManager.java:789)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1216)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1137)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:944)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:880)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1168)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:125)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)[felix.jar:]
  	at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)[felix.jar:]
  	at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)[felix.jar:]
  	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4833)[felix.jar:]
  	at org.apache.felix.framework.Felix.registerService(Felix.java:3804)[felix.jar:]
  	at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328)[felix.jar:]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:907)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:893)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:128)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:960)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:733)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:341)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:297)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1216)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1137)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:944)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:880)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1168)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:125)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)[felix.jar:]
  	at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)[felix.jar:]
  	at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)[felix.jar:]
  	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4833)[felix.jar:]
  	at org.apache.felix.framework.Felix.registerService(Felix.java:3804)[felix.jar:]
  	at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328)[felix.jar:]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:907)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:893)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:128)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:960)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:733)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:667)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:433)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:441)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:340)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.scr.impl.manager.RegionConfigurationSupport$2.configurationEvent(RegionConfigurationSupport.java:115)[92:org.apache.felix.scr:2.1.18]
  	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:1704)[84:org.apache.felix.configadmin:1.9.14]
  	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1646)[84:org.apache.felix.configadmin:1.9.14]
  	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)[84:org.apache.felix.configadmin:1.9.14]
  	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)[84:org.apache.felix.configadmin:1.9.14]
  	at java.base/java.lang.Thread.run(Thread.java:834)[:]

I've compared my implementation with eg the NqlServlet and I don't see what I could be doing wrong, other than being in a bundle that requires Java 11.
Google suggests ( https://issues.apache.org/jira/browse/XBEAN-326 ) that the issue might indeed be with Java 11 or better said with having a module-info.class.
Locally I can't get it reproduced using either Java 11 or Java 13.

@kharybdys
Copy link
Contributor Author

I'm realizing the difference is probably Karaf (test) vs Equinox (local). See the following issue in Karaf:
https://issues.apache.org/jira/browse/AMQ-7431

@ghost ghost self-assigned this Aug 18, 2020
@ghost ghost added bug Something isn't working 2 - Working Working on this issue. labels Aug 18, 2020
@ghost ghost added the 0 - Backlog New issue, unvetted. label Sep 10, 2020
@ghost ghost removed their assignment Sep 10, 2020
@ghost ghost removed the 2 - Working Working on this issue. label Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - Backlog New issue, unvetted. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant