Uploaded image for project: 'Stanbol'
  1. Stanbol
  2. STANBOL-1413

NPE in Freemaker BundleTemplateLoader

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.12.0
    • Fix Version/s: 1.0.0, 0.12.1
    • Component/s: Commons
    • Labels:
      None

      Description

      I very rare cases the Freemaker BundleTemplate loader is getting NPE when loading resources from bundles.

          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)
      

      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.

        Attachments

          Activity

            People

            • Assignee:
              rwesten Rupert Westenthaler
              Reporter:
              rwesten Rupert Westenthaler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: