Problems with loading freemarker template as external resource

Hello there

I’m using default tomcat installation as is. There are 2 Service Tasks. Both are using the soap-http-connector. Both has payload as freemarker templates but one as ad-hoc and another as external resource. Till today both are working as expected, but since today the task with external freemarker template produces this exception (see below). Any suggestions?

initialize class freemarker.template.Configuration, deploymentId=079e9d91-f4ba-11e8-91aa-9457a5d3d79b]:
at org.camunda.bpm.engine.impl.jobexecutor.JobExecutorLogger.wrapJobExecutionFailure(JobExecutorLogger.java:158)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:57)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:40)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:88)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class freemarker.template.Configuration
at org.camunda.templateengines.FreeMarkerScriptEngine.initConfiguration(FreeMarkerScriptEngine.java:84)
at org.camunda.templateengines.FreeMarkerScriptEngine.compile(FreeMarkerScriptEngine.java:105)
at org.camunda.templateengines.FreeMarkerScriptEngine.compile(FreeMarkerScriptEngine.java:101)
at org.camunda.bpm.engine.impl.scripting.SourceExecutableScript.compile(SourceExecutableScript.java:101)
at org.camunda.bpm.engine.impl.scripting.SourceExecutableScript.compileScript(SourceExecutableScript.java:80)
at org.camunda.bpm.engine.impl.scripting.SourceExecutableScript.evaluate(SourceExecutableScript.java:53)
at org.camunda.bpm.engine.impl.scripting.ResourceExecutableScript.evaluate(ResourceExecutableScript.java:43)
at org.camunda.bpm.engine.impl.scripting.ExecutableScript.execute(ExecutableScript.java:59)
at org.camunda.bpm.engine.impl.scripting.env.ScriptingEnvironment.execute(ScriptingEnvironment.java:97)
at org.camunda.bpm.engine.impl.scripting.env.ScriptingEnvironment.execute(ScriptingEnvironment.java:83)
at org.camunda.bpm.engine.impl.delegate.ScriptInvocation.invoke(ScriptInvocation.java:40)
at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:54)

Try and error shows that the problem was log4 librarary in WEB-INF/lib/org.apache.log4j-1.2.17.jar.

Hi roman-mkh ,

I am also facing the same issue . Can you let me know how this can be fixed . I am using camunda distribution package without any modifications .

Thanks
Dinesh

Hello dineshsb,

I had the log4j which was incompatible with camunda in my application war. So I removed and use a loger solution from camunda.

best regards
Roman

1 Like

Hi roman-mkh ,

Thanks for the inputs . It worked :slight_smile: . Looks like there was a conflict of Log4j between the one p[provided by the camunda distribution package and the war i generated and it resolved the issue . Tricky thing was that the error says no class def for the freemarker template configuration class .