OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.15k stars 590 forks source link

Dynamic feature update causes NPE from mpOpenAPI #21945

Closed tevans78 closed 10 months ago

tevans78 commented 2 years ago

I was running with mpOpenAPI-3.1 but I suspect the problem happens with other versions too. If I dynamically (without stopping the server) add or removed jakartaee-9.1 or jakartaee-10.0 (again I am guessing that other features might cause the problem as well) then I get an NPE...

[8/3/22, 12:11:09:464 BST] 00000038 com.ibm.ws.webcontainer.webapp                               E SRVE0276E: Error while initializing Servlet [ApplicationServlet]: jakarta.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:368)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1401)
    at com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:1211)
    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:1179)
    at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1077)
    at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6685)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:472)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApplication(DynamicVirtualHost.java:467)
    at com.ibm.ws.webcontainer.osgi.WebContainer.startWebApplication(WebContainer.java:1188)
    at com.ibm.ws.webcontainer.osgi.WebContainer.access$100(WebContainer.java:111)
    at com.ibm.ws.webcontainer.osgi.WebContainer$3.run(WebContainer.java:985)
    at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:245)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
    at java.base/java.lang.Thread.run(Thread.java:845)
Caused by: java.lang.NullPointerException
    at org.osgi.util.tracker.ServiceTracker.<init>(ServiceTracker.java:187)
    at org.osgi.util.tracker.ServiceTracker.<init>(ServiceTracker.java:250)
    at io.openliberty.microprofile.openapi20.internal.servlets.ApplicationServlet.init(ApplicationServlet.java:53)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:299)
    ... 16 more
ryan-storey commented 10 months ago

This bug was fixed with code changes delivered in 23.0.0.7.