5 Replies Latest reply on Aug 6, 2013 5:53 PM by Martin Trummer

    Freemarker does not find template on classpath

    Martin Trummer Newbie

      Using JBoss 7.1.1-FINAL freemarker does not find its libraries via class path (worked perfectly well on version 5) - same error happens on EAP 6.1...

       

      We have several WAR files deployed to the application server and one of those WARs contain a JAR which hosts the template files in META-INF/templates/packages/file.ftl

      Configuration of Freemarker:

      setTemplateLoaderPath("classpath:/META-INF/templates/com.cg.g3his.med/");

       

      Stack:

      Caused by: java.lang.IllegalStateException: java.io.FileNotFoundException: Template MedicationOrderSummary.ftl not found.

      at com.cg.g3his.med.freemarker.FreemarkerTemplateProcessor.process(FreemarkerTemplateProcessor.java:55) [med-medication-impl-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT]

      at com.cg.g3his.med.builders.SummaryBuilders$MedicationSummaryBuilder.build(SummaryBuilders.java:171) [med-medication-impl-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT]

      at com.cg.g3his.med.singlemedication.SingleMedicationSummaryFacadeImpl.createOrderContextSummary(SingleMedicationSummaryFacadeImpl.java:57) [med-medication-impl-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT]

      at com.cg.g3his.sma.interfaces.external.ordering.summary.AbstractOrderContextSummaryProvider.createOrderSummary(AbstractOrderContextSummaryProvider.java:40) [tsm.api.java-3.1.0-20130723.004333-91.jar:3.1.0-SNAPSHOT]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_37]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_37]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_37]

      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_37]

      at com.cg.helix.methodbinding.MethodExecutor.execute(MethodExecutor.java:62) [helix-core-2.9.2-20130722.151404-78.jar:2.9.2-SNAPSHOT]

      ... 25 more

      Caused by: java.io.FileNotFoundException: Template MedicationOrderSummary.ftl not found.

      at freemarker.template.Configuration.getTemplate(Configuration.java:580) [freemarker-2.3.19.jar:2.3.19]

      at freemarker.template.Configuration.getTemplate(Configuration.java:543) [freemarker-2.3.19.jar:2.3.19]

      at com.cg.g3his.med.freemarker.FreemarkerTemplateProcessor.process(FreemarkerTemplateProcessor.java:50) [med-medication-impl-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT]

      ... 33 more

       

      What I've noticed so far is that in the virtual file system I do see following path "jboss-as-7.1.1.Final\standalone\tmp\vfs\deployment220be65c1a50976\med-medication-impl-3.1.0-SNAPSHOT.jar-38da8efa22b6bf25\contents\META-INF\templates\com.cg.g3his.med" but it does not contain any template file.