freemarker ,DEFAULT_INCOMPATIBLE_IMPROVEMENTS
程序员文章站
2022-03-03 21:44:37
...
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'freemarkEngine' defined in class path resource [conf/app-resources.xml]: Cannot resolve reference to bean 'freemarkerConfiguration' while setting bean property 'configuration';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'freemarkerConfiguration' defined in class path resource [conf/app-resources.xml]:
Invocation of init method failed;
nested exception is java.lang.NoSuchFieldError: DEFAULT_INCOMPATIBLE_IMPROVEMENTS
版本不对。使用新版本:
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.23</version>
</dependency>
而不是:
<dependency>
<groupId>freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.9</version>
</dependency>
Error creating bean with name 'freemarkEngine' defined in class path resource [conf/app-resources.xml]: Cannot resolve reference to bean 'freemarkerConfiguration' while setting bean property 'configuration';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'freemarkerConfiguration' defined in class path resource [conf/app-resources.xml]:
Invocation of init method failed;
nested exception is java.lang.NoSuchFieldError: DEFAULT_INCOMPATIBLE_IMPROVEMENTS
版本不对。使用新版本:
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.23</version>
</dependency>
而不是:
<dependency>
<groupId>freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.9</version>
</dependency>
推荐阅读
-
springboot整合freemarker模板
-
freemarker 数字格式化深入理解
-
Java实现用Freemarker完美导出word文档(带图片)
-
java Freemarker页面静态化实例详解
-
FreemarkerJavaDemo【Android将表单数据生成Word文档的方案之一(基于freemarker2.3.28,只能java生成)】
-
springboot(9)——整合freemarker
-
java官网门户源码 SSM框架 自适应-响应式 freemarker 静态模版引擎
-
使用FreeMarker导出word文档(支持导出图片)
-
JSPSupportServlet Struts2与FreeMarker配合使用
-
freemarker遍历map教程