[
https://issues.apache.org/jira/browse/STANBOL-1413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14342983#comment-14342983
]
Rupert Westenthaler commented on STANBOL-1413:
----------------------------------------------
added a check for NPE with http://svn.apache.org/r1663231 for 0.12.1
Further investigation of this issue on the affected Stanbol instance indicated
that his might have been cause by some issues with two affected bundles. The
logs showed an other NPE while loading a class from an affected Bundle. So the
cause of this might be related to corrupted bundle in the specific installation.
Reinstalling Stanbol on the affected server solved the issue (even without the
fix). Nonetheless IMO it is worth catching the reported exception so I will
keep the fix.
> NPE in Freemaker BundleTemplateLoader
> -------------------------------------
>
> Key: STANBOL-1413
> URL: https://issues.apache.org/jira/browse/STANBOL-1413
> Project: Stanbol
> Issue Type: Bug
> Components: Commons
> Affects Versions: 0.12.0
> Reporter: Rupert Westenthaler
> Assignee: Rupert Westenthaler
> Priority: Minor
> Fix For: 1.0.0, 0.12.1
>
>
> I very rare cases the Freemaker BundleTemplate loader is getting NPE when
> loading resources from bundles.
> {code}
> java.lang.NullPointerException
> at
> org.apache.felix.framework.BundleRevisionImpl.getResourceLocal(BundleRevisionImpl.java:495)
> at
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1472)
> at
> org.apache.felix.framework.BundleWiringImpl.getResourceByDelegation(BundleWiringImpl.java:1400)
> at
> org.apache.felix.framework.Felix.getBundleResource(Felix.java:1600)
> at
> org.apache.felix.framework.BundleImpl.getResource(BundleImpl.java:639)
> at
> org.apache.stanbol.commons.freemarker.impl.BundleTemplateLoader.containsTemplates(BundleTemplateLoader.java:117)
> {code}
> This NPE happens when trying to load the resource `templates/` via
> {{Bundle.getResource(..)}}. Even if it appears it does only affect few of the
> installed bundles.
> As the call is only used to check if the folder `templates/` is available in
> a bundle an exception MUST NOT break the whole BundleTemplateLoader
> initialization. Because of that the code needs to be changed to catch this
> NPE and log it on WARN level.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)