Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
webconsole-4.2.2
-
None
Description
If you try to refresh packages on the webconsole or it's dependencies (like the fileupload) bundle, the following exception will be printed in the log file:
[ERROR]8 : [HTTP] Problem while making answer to request /system/console/bundles/19 from client address 127.0.0.1:63063
java.lang.NullPointerException
at org.osgi.util.tracker.ServiceTracker.<init>(ServiceTracker.java:207)
at org.apache.felix.webconsole.SimpleWebConsolePlugin.getService(SimpleWebConsolePlugin.java:196)
at org.apache.felix.webconsole.internal.core.BundlesServlet.getPackageAdmin(BundlesServlet.java:1403)
at org.apache.felix.webconsole.internal.core.BundlesServlet.isFragmentBundle(BundlesServlet.java:715)
at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:358)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:493)
at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:418)
The reason is that the refresh will cause the webconsole bundle to be restarted. Here is what happens:
- doPost entered
- sent package refresh
- webconsole bundle is stopped
- web console tries to access a service
- NPE
- doPost leaving
To prevent that, the bundle plugin should simply check if the bundleContext is null