问题
I'm using FreeMarker with a Play 2.3.8 app. When I execute my tests, sometimes I get the following error :
Caused by: java.io.FileNotFoundException: Template "MyTemplate.tpl" not found. The quoted name was interpreted by this template loader: ClassTemplateLoader(baseClass=com.project.TemplateEngineConfigurer, packagePath="templates/").
MyTemplate.tpl
is in com.project.templates
package and I'm using the following configuration :
Configuration config = new Configuration(Configuration.getVersion());
config.setClassForTemplateLoading(getClass(), "templates");
config.setDefaultEncoding("UTF-8");
config.setCacheStorage(new MruCacheStorage(20, 250));
return config;
I can't understand why I have randomly, file not found exception... Is it an Eclipse problem ? A cache problem ?
Thanks.
来源:https://stackoverflow.com/questions/28987504/random-template-not-found-with-freemarker