gpt4 book ai didi

java - 使用 freemarker 模板错误发生配置失败

转载 作者:行者123 更新时间:2023-12-03 03:54:06 58 4
gpt4 key购买 nike

@Autowired
private Configuration freemarkerConfig;

获取以下异常,

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"

最佳答案

我有同样的问题,确保你 Autowiring 正确的FreeMarker Configuration,或者使用

@Autowired
private freemarker.template.Configuration freeMarker;

关于java - 使用 freemarker 模板错误发生配置失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63068292/

58 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com