I get a file not found exception while loading a freemarker template even though the template is actually present in the path.
Update: This is running as a webservi
Actually you're expected to specify absolute path (not relative) for dir where template is going to be place, see FreeMaker.Configuration:
setDirectoryForTemplateLoading(java.io.File dir)
Sets the file system directory from which to load templates.
Note that FreeMarker can load templates from non-file-system sources too. See setTemplateLoader(TemplateLoader) from more details.
For instance, this is how to get template from src/test/resources/freemarker:
private String final PATH = "src/test/resources/freemarker"
// getting singleton of Configuration
configuration.setDirectoryForTemplateLoading(new File(PATH))
// surrounded by try/catch