I’m trying to send an email with a template file included as resource.
The main file is detected, but seems it’s not finding the include file
I’m not sure why is not finding it because it’s there.
Any solution for this?
25-Jan-2017 16:42:57.732 SEVERE [pool-2-thread-1] org.camunda.commons.logging.BaseLogger.logError ENGINE-16006 BPMN Stack Trace:
25-Jan-2017 16:42:57.732 SEVERE [pool-2-thread-1] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: Unable to evaluate script: freemarker.core._MiscTemplateException: Error reading included file “./footer.ftl”:
I think we need a way for freemarker configuration to configure the template location for the templates so I can use include.
This file has been truncated.
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
If we could have a configuration that I can setup and point to the proper folder with the templates.
@lcrodriguez where is
footer.ftl located in your project? could you post a tree?
Sure. I have a project with my processes which I generate as a war and drop into tomcat webapps.
And I’m using it like this in a connector:
<camunda:script scriptFormat="freemarker" resource="templates/premium-request/no-records.ftl" />
I guess it’s not looking for the templates in the classpath folder because it does not know about them and I could not find a way to configure them.
does it work if you adjust your
Yes. I tried that and did not work either.
with same stack trace or different?
Yes, unfortunately. I will try again just in case and post results again.
that means that freemarker template is not on the same classpath, to verify that could you try to put your template directly into engine webapp’s classes folder?
I’m using Tomcat. Where should that be located?
that’s a shared engine I assume, so probably
I see what you mean. That would be a workaround to symlink my folder here… not ideal but should work.
We should be able to configure the locations for freemarker templates somehow in the future, this is very useful for customizations.
This thread from the old forum may be of interest.
In addition, it looks like
this (CAM-3688) ticket may be related .
https://app.camunda.com/jira/browse/CAM-3688 looks like exactly what you need. You can vote on that ticket, but I cannot do any promises on when it will be implemented. If you want you can always prepare pull request with implementation, they are more then welcome.
I could do a PR reading from the camunda.cfg.xml the configuration paths either file or classpaths so it’s more generic.
How could I read the configuration file?