You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2012/09/17 09:59:08 UTC
[jira] [Commented] (FELIX-3666) NPE when uninstalling a bundle
[ https://issues.apache.org/jira/browse/FELIX-3666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456868#comment-13456868 ]
Felix Meschberger commented on FELIX-3666:
------------------------------------------
I think this is a bug in the framework, though.
The PackageAdmin.isBundleType is defined to throw an IllegalArgumentException "If the specified Bundle was not created by the same framework instance that registered this PackageAdmin service". I would assume calling this method on an uninstalled bundle should just return the information because it basically just accesses the bundle headers which must remain available after the bundle has been uninstalled.
In fact the PackageAdminImpl.isBundleType does
bundle.adapt(BundleRevision.class))
which will return null if the bundle is uninstalled. Instead it should do
bundle.adapt(BundleRevisionImpl.class))
which never returns null and thus still provides access to the headers.
> NPE when uninstalling a bundle
> ------------------------------
>
> Key: FELIX-3666
> URL: https://issues.apache.org/jira/browse/FELIX-3666
> Project: Felix
> Issue Type: Bug
> Components: Web Console
> Affects Versions: webconsole-4.0.0
> Reporter: Carsten Ziegeler
> Fix For: webconsole-4.0.2
>
>
> When uninstalling a bundle from the bundle list, a NPE in the framework occurs - I think this starts to happen with framework 4.0.3, but I think this is not a problem of the framework but a bug in the web console.
> This is the stack trace:
> 14.09.2012 13:44:54.858 *INFO* [0:0:0:0:0:0:0:1%0 [1347623094009] POST /system/console/bundles/108 HTTP/1.1] servletengine Servlet threw exception: java.lang.NullPointerException
> at org.apache.felix.framework.PackageAdminImpl.getBundleType(PackageAdminImpl.java:112)
> at org.apache.felix.webconsole.internal.core.BundlesServlet.isFragmentBundle(BundlesServlet.java:715)
> at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:358)
> Although the bundle is uninstalled, the web console tries to find out whether the bundle is a fragment to report a status in the json. I think this doesn't make sense for an uninstalled bundle
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira