Chinnappa Raj J
Chinnappa Raj J

Reputation: 101

using of freemarker template error occurs configuration failed

@Autowired
private Configuration freemarkerConfig;

Getting the following exception,

Unsatisfied dependency expressed through field 'freemarkerConfig';
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'freeMarkerConfiguration' defined in class path resource [org/springframework/boot/autoconfigure/freemarker/FreeMarkerServletWebConfiguration.class]: Unsatisfied dependency expressed through method 'freeMarkerConfiguration' parameter 0; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'freeMarkerConfigurer' defined in class path resource [org/springframework/boot/autoconfigure/freemarker/FreeMarkerServletWebConfiguration.class]: Invocation of init method failed; 
nested exception is freemarker.core.Configurable$UnknownSettingException: Unknown FreeMarker configuration setting: "recognize_standard_file_extensions"

Upvotes: 3

Views: 3426

Answers (1)

Thirumal
Thirumal

Reputation: 9546

I had the same issue, make sure you are autowiring correct FreeMarker Configuration, or use

@Autowired
private freemarker.template.Configuration freeMarker;

Upvotes: 1

Related Questions