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

NPE in Freemaker BundleTemplateLoader

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.12.0
    • 1.0.0, 0.12.1
    • Commons
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: