You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Sandeep Nayak (JIRA)" <ji...@apache.org> on 2013/10/24 17:20:10 UTC

[jira] [Commented] (FELIX-4068) Restarting Felix from Web Console throwing a NullPointerException and wouldn't restart (2 fixes/work-arounds required in org.apache.felix.framework.BundleRevisionImpl)

    [ https://issues.apache.org/jira/browse/FELIX-4068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13804308#comment-13804308 ] 

Sandeep Nayak commented on FELIX-4068:
--------------------------------------

I see this exception in embedded mode too. Is this going to be considered for a fix anytime soon?

Richard could you clarify what could result in the content path being null and why it should never be null? 

It would appear that a null check would be appropriate given that a NPE is probably not what anyone wants to see, if the expectation is that the content path is never null and a null is found it should result in something akin to IllegalStateException.

> Restarting Felix from Web Console throwing a NullPointerException and wouldn't restart (2 fixes/work-arounds required in org.apache.felix.framework.BundleRevisionImpl)
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-4068
>                 URL: https://issues.apache.org/jira/browse/FELIX-4068
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.0.0
>         Environment: I am running OSGi Felix 4.2.0, and when re-starting from Web console - following error created for pax-web-jetty-bundle-2.1.2.jar
> java.lang.NullPointerException
>                 at org.apache.felix.framework.BundleRevisionImpl.getResourceLocal(BundleRevisionImpl.java:498)
>                 at org.apache.felix.framework.Felix.getBundleResource(Felix.java:1595)
>                 at org.apache.felix.framework.BundleImpl.getResource(BundleImpl.java:639)
>                 at org.ops4j.pax.swissbox.core.BundleClassLoader.findResource(BundleClassLoader.java:210)
>                 at org.ops4j.pax.swissbox.core.BundleClassLoader.getResource(BundleClassLoader.java:142)
>                 at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1193)
>                 at javax.xml.parsers.SecuritySupport$4.run(SecuritySupport.java:96)
>                 at java.security.AccessController.doPrivileged(Native Method)
>                 at javax.xml.parsers.SecuritySupport.getResourceAsStream(SecuritySupport.java:89)
>                 at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:250)
>                 at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:223)
>                 at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)
>                 at org.ops4j.util.xml.ElementHelper.getRootElement(ElementHelper.java:68)
>                 at org.ops4j.pax.web.service.internal.DefaultPropertyResolver.getDefaltProperties(DefaultPropertyResolver.java:64)
>                 at org.ops4j.pax.web.service.internal.DefaultPropertyResolver.<init>(DefaultPropertyResolver.java:55)
>                 at org.ops4j.pax.web.service.internal.Activator.updateController(Activator.java:289)
>                 at org.ops4j.pax.web.service.internal.Activator$4.run(Activator.java:258)
>                 at org.ops4j.pax.web.service.internal.Executor$Future.run(Executor.java:45)
>                 at org.ops4j.pax.web.service.internal.Executor$Worker.run(Executor.java:122)
> Following is the set of my bundles:
> cd /Felix/felix-framework-4.2.0
> java -Dorg.osgi.framework.bootdelegation=sun.misc -jar bin/felix.jar
> install file:bin/logging/slf4j-api-1.7.2.jar
> install file:bin/logging/logback-core-1.0.9.jar
> install file:bin/logging/logback-classic-1.0.9.jar
> install file:bin/console/org.apache.felix.configadmin-1.6.0.jar
> install file:bin/base/pax-web-jetty-bundle-2.1.2.jar
> install file:bin/base/commons-io-2.4.jar
> install file:bin/base/commons-codec-1.7.jar
> install file:bin/base/commons-collections-3.2.1.jar
> install file:bin/base/commons-httpclient-3.1.0.jar
> install file:bin/base/commons-fileupload-1.2.2.jar
> install file:bin/base/commons-logging-1.1.1.jar
> install file:bin/base/org.ow2.chameleon.commons.json-20090911-0002.jar
> install file:bin/console/org.apache.felix.webconsole-4.0.0.jar
> install file:bin/console/org.apache.felix.metatype-1.0.6.jar
> install file:bin/console/org.apache.felix.log-1.0.1.jar
>            Reporter: Pavel B
>              Labels: Restart-Felix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Same fix/work-around in 2 methods of class: org.apache.felix.framework.BundleRevisionImpl
>     URL getResourceLocal(String name)
>     Enumeration getResourcesLocal(String name)
> Instead of:                if (contentPath.get(i).hasEntry(name))
> Should be:                if (contentPath.get(i) != null && contentPath.get(i).hasEntry(name))



--
This message was sent by Atlassian JIRA
(v6.1#6144)