-
Notifications
You must be signed in to change notification settings - Fork 8
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
NullPointerException in Vaadin 14 when trying to start with karaf #296
Comments
@GMMStraider Thank you for reporting. Could you please provide this mentioned TestRepository or some simplified version of the failing test case to help us reproducing the issue? |
@tltv Hi, I have created a test project for the issue https://github.com/GMMStraider/vaadin-osgi-karaf-test |
Meanwhile before fix is ready, workaround is to override
|
The workaround works. Unfortunately I then come to a new problem when I also try to enable push. I will see if I can find information about the issue when I have some more time. Error Message:
|
I noticed I had an older version of atmosphere version in the features. But updating the version to 2.7.3.slf4jvaadin4 has unfortunately not fixed the issue. But I am now also getting a warning in the log: ================================================================= Atmosphere could not be loaded. When using push with Vaadin, the Atmosphere framework must be present on the classpath. If using a dependency management system, please add a dependency to vaadin-push. If managing dependencies manually, please make sure Atmosphere 2.7.3.slf4jvaadin4 is included on the classpath. Will fall back to using PushMode.DISABLED. ================================================================= The atmosphere bundle is installed, active and has the correct exports. From that side everything should be working as expected. |
Did Push work before with 14.5.5? |
Yes. I have vaadin with push working in karaf with version 14.5.5 |
I'm running with Karaf 4.3.9 and push seems to be working in Long polling transport mode. You can try it e.g. with |
Swapping to long polling did not change anything. |
I do get the same Websocket transport mode is not working and log has errors about that like |
I found the issue on my side! I had the build slightly wrong. Long polling should work fine for our project. I will try it out. Thanks! |
When trying to run inside karaf (4.3.7) Vaadin 14.9.8 throws a NullPointerException.
How to reproduce
Build the base started project for the v14 branch. Start karaf and install the test feature from the TestRepository
`bin/karaf
feature:repo-add file:/path-to-xml
feature:install test`
features.xml:
`
http http-whiteboard mvn:org.jsoup/jsoup/1.15.3 spifly mvn:com.helger/ph-commons/9.1.2 mvn:com.helger/ph-css/6.1.1 mvn:net.bytebuddy/byte-buddy/1.12.19 mvn:commons-fileupload/commons-fileupload/1.5 mvn:com.vaadin.external.atmosphere/atmosphere-runtime/2.4.30.slf4jvaadin1 mvn:com.vaadin.external/gentyref/1.2.0.vaadin1 mvn:com.vaadin/flow-client/2.8.7 mvn:com.vaadin/flow-data/2.8.7 mvn:com.vaadin/flow-dnd/2.8.7 mvn:com.vaadin/flow-html-components/2.8.7 mvn:com.vaadin/flow-osgi/2.8.7 mvn:com.vaadin/flow-push/2.8.7 mvn:com.vaadin/flow-server/2.8.7 mvn:com.vaadin/vaadin-lumo-theme/2.8.7 mvn:com.vaadin/vaadin-material-theme/2.8.7 mvn:com.vaadin/vaadin-accordion-flow/14.9.8 mvn:com.vaadin/vaadin-app-layout-flow/14.9.8 mvn:com.vaadin/vaadin-button-flow/14.9.8 mvn:com.vaadin/vaadin-checkbox-flow/14.9.8 mvn:com.vaadin/vaadin-combo-box-flow/14.9.8 mvn:com.vaadin/vaadin-context-menu-flow/14.9.8 mvn:com.vaadin/vaadin-custom-field-flow/14.9.8 mvn:com.vaadin/vaadin-date-picker-flow/14.9.8 mvn:com.vaadin/vaadin-date-time-picker-flow/14.9.8 mvn:com.vaadin/vaadin-details-flow/14.9.8 mvn:com.vaadin/vaadin-dialog-flow/14.9.8 mvn:com.vaadin/vaadin-form-layout-flow/14.9.8 mvn:com.vaadin/vaadin-grid-flow/14.9.8 mvn:com.vaadin/vaadin-icons-flow/14.9.8 mvn:com.vaadin/vaadin-iron-list-flow/14.9.8 mvn:com.vaadin/vaadin-list-box-flow/14.9.8 mvn:com.vaadin/vaadin-login-flow/14.9.8 mvn:com.vaadin/vaadin-menu-bar-flow/14.9.8 mvn:com.vaadin/vaadin-notification-flow/14.9.8 mvn:com.vaadin/vaadin-ordered-layout-flow/14.9.8 mvn:com.vaadin/vaadin-progress-bar-flow/14.9.8 mvn:com.vaadin/vaadin-radio-button-flow/14.9.8 mvn:com.vaadin/vaadin-select-flow/14.9.8 mvn:com.vaadin/vaadin-split-layout-flow/14.9.8 mvn:com.vaadin/vaadin-tabs-flow/14.9.8 mvn:com.vaadin/vaadin-text-field-flow/14.9.8 mvn:com.vaadin/vaadin-time-picker-flow/14.9.8 mvn:com.vaadin/vaadin-upload-flow/14.9.8 mvn:com.vaadin.external.gwt/gwt-elemental/2.8.2.vaadin2 mvn:com.vaadin.external.slf4j/vaadin-slf4j-jdk14/1.6.1 mvn:com.vaadin/license-checker/1.12.3 mvn:com.nimbusds/nimbus-jose-jwt/9.31 mvn:org.lucee/jcip-annotations/1.0.0 mvn:com.vaadin/open/8.5.0 eventadmin scr apache-http-components apache-commons vaadin webconsole mvn:com.example/project-base-osgi/1.0-SNAPSHOT mvn:org.apache.httpcomponents/httpclient-osgi/4.5.13 mvn:org.apache.httpcomponents/httpcore-osgi/4.4.14 mvn:commons-lang/commons-lang/2.6 mvn:commons-net/commons-net/2.2 mvn:commons-io/commons-io/2.11.0 mvn:org.apache.commons/commons-lang3/3.12.0 mvn:org.apache.commons/commons-collections4/4.4 mvn:org.apache.commons/commons-math3/3.6.1 mvn:org.apache.commons/commons-compress/1.21 mvn:org.apache.commons/commons-text/1.9 mvn:commons-codec/commons-codec/1.10 `mvn:org.apache.karaf.features/framework/4.3.7/xml/features
mvn:org.apache.karaf.features/specs/4.3.7/xml/features
All bundles start. But the base starter bundle throws an exception when it tries to initialize the servlet.
Caused by: java.lang.NullPointerException at com.vaadin.flow.server.DeploymentConfigurationFactory.getTokenFileFromClassloader(DeploymentConfigurationFactory.java:359) at com.vaadin.flow.server.DeploymentConfigurationFactory.getTokenFileContents(DeploymentConfigurationFactory.java:329) at com.vaadin.flow.server.DeploymentConfigurationFactory.readBuildInfo(DeploymentConfigurationFactory.java:184) at com.vaadin.flow.server.DeploymentConfigurationFactory.createInitParameters(DeploymentConfigurationFactory.java:177) at com.vaadin.flow.server.VaadinServlet.createDeploymentConfiguration(VaadinServlet.java:152) at com.vaadin.flow.server.VaadinServlet.createServletService(VaadinServlet.java:190) at com.vaadin.flow.server.VaadinServlet.init(VaadinServlet.java:77) at com.example.starter.base.osgi.VaadinServletRegistration$FixedVaadinServlet.init(VaadinServletRegistration.java:31) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:632) ... 76 more
Full StackTrace:
java.lang.RuntimeException: javax.servlet.ServletException: org.ops4j.pax.web.service.spi.model.ServletModel-56==com.example.starter.base.osgi.VaadinServletRegistration$FixedVaadinServlet@b9f03ed9{jsp=null,order=-1,inst=true,async=true,src=EMBEDDED:null,STARTED} at org.eclipse.jetty.servlet.ServletHandler.initializeHolders(ServletHandler.java:785) at org.eclipse.jetty.servlet.ServletHandler.setServlets(ServletHandler.java:1531) at org.eclipse.jetty.servlet.ServletHandler.addServlet(ServletHandler.java:913) at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$2.call(JettyServerImpl.java:425) at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$2.call(JettyServerImpl.java:421) at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60) at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.addServlet(JettyServerImpl.java:420) at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Started.addServlet(ServerControllerImpl.java:317) at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.addServlet(ServerControllerImpl.java:122) at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:250) at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:395) at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:504) at org.ops4j.pax.web.extender.whiteboard.internal.element.ServletWebElement.register(ServletWebElement.java:102) at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerWebElement(WebApplication.java:392) at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.addWebElement(WebApplication.java:188) at org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.addingService(AbstractTracker.java:191) at org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.addingService(AbstractTracker.java:44) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:871) at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:903) at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990) at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838) at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545) at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4833) at org.apache.felix.framework.Felix.registerService(Felix.java:3804) at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328) at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:335) at com.example.starter.base.osgi.VaadinServletRegistration.activate(VaadinServletRegistration.java:55) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:244) at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:685) at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:529) at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:318) at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:308) at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:354) at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:115) at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:1000) at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:973) at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:785) at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:674) at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:437) at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:667) at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:305) at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:554) at org.apache.felix.scr.impl.Activator.access$200(Activator.java:70) at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:421) at org.apache.felix.scr.impl.AbstractExtender.createExtension(AbstractExtender.java:196) at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:169) at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:49) at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:488) at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:420) at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) at org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915) at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834) at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516) at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4817) at org.apache.felix.framework.Felix.startBundle(Felix.java:2336) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984) at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.startBundle(BundleInstallSupportImpl.java:165) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1160) at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1041) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: javax.servlet.ServletException: org.ops4j.pax.web.service.spi.model.ServletModel-56==com.example.starter.base.osgi.VaadinServletRegistration$FixedVaadinServlet@b9f03ed9{jsp=null,order=-1,inst=true,async=true,src=EMBEDDED:null,STARTED} at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:650) at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:415) at org.eclipse.jetty.servlet.ServletHandler.initializeHolders(ServletHandler.java:780) ... 74 more Caused by: java.lang.NullPointerException at com.vaadin.flow.server.DeploymentConfigurationFactory.getTokenFileFromClassloader(DeploymentConfigurationFactory.java:359) at com.vaadin.flow.server.DeploymentConfigurationFactory.getTokenFileContents(DeploymentConfigurationFactory.java:329) at com.vaadin.flow.server.DeploymentConfigurationFactory.readBuildInfo(DeploymentConfigurationFactory.java:184) at com.vaadin.flow.server.DeploymentConfigurationFactory.createInitParameters(DeploymentConfigurationFactory.java:177) at com.vaadin.flow.server.VaadinServlet.createDeploymentConfiguration(VaadinServlet.java:152) at com.vaadin.flow.server.VaadinServlet.createServletService(VaadinServlet.java:190) at com.vaadin.flow.server.VaadinServlet.init(VaadinServlet.java:77) at com.example.starter.base.osgi.VaadinServletRegistration$FixedVaadinServlet.init(VaadinServletRegistration.java:31) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:632) ... 76 more
The text was updated successfully, but these errors were encountered: