Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2608

Tag library support in freemarker does't work with expanded jars

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 4.0
    • templating
    • None

    Description

      freemarker can't load tag libraries when magnolia (magnolia/trunk) is run inside eclipse. The magnolia webapp is run from the eclipse workspace, without copying resources to a standard webapp layout (WEB-INF/lib doesn't exists and taglib modules are not jarred).
      Unfortunately freemarker looks for taglib in a WEB-INF/lib folder explicitly and dies with a NPE if the folder is missing:

      Caused by: java.lang.NullPointerException
      at freemarker.ext.jsp.TaglibFactory.getLocationsFromLibJars(TaglibFactory.java:290)
      at freemarker.ext.jsp.TaglibFactory.getMoreTaglibLocations(TaglibFactory.java:206)
      at freemarker.ext.jsp.TaglibFactory.get(TaglibFactory.java:163)

      .. or simply complains about the missing taglib if an empty WEB-INF/lib directory is created:

      freemarker.template.TemplateModelException: Could not find webapp resource /cms-taglib
      at freemarker.ext.jsp.TaglibFactory.loadTaglib(TaglibFactory.java:432)
      at freemarker.ext.jsp.TaglibFactory.access$300(TaglibFactory.java:106)
      at freemarker.ext.jsp.TaglibFactory$Taglib.load(TaglibFactory.java:414)

      (tried by simply adding the demo-project dependency to the empty webapp)

      unfortunately really annoying during development...

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                fgiust Fabrizio Giustina
                fgiust Fabrizio Giustina
                Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD