主要遇到以下两个问题:
freemarker.template.TemplateHashModelEx
Exception in thread "main" java.lang.NoClassDefFoundError: freemarker/template/TemplateHashModelEx
.
.
.
Caused by: java.lang.ClassNotFoundException: freemarker.template.TemplateHashModelEx
.
.
.
在pom.xml中加入,
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker-gae</artifactId>
<version>2.3.18</version>
</dependency>
Caused by: java.lang.NoClassDefFoundError: org/springframework/ui/freemarker/FreeMarkerConfiguration
1. Build path is incomplete. Cannot find class file for org/springframework/ui/freemarker/
FreeMarkerConfigurationFactory
2.No setter found for property 'templateLoaderPath' in class
'org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer' [config set: Warehouse/web-context]
在pom.xml中加入
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
本文解决了在使用Freemarker模板引擎时遇到的NoClassDefFoundError异常,并介绍了如何通过修改pom.xml文件引入正确的依赖来解决Spring集成过程中出现的问题。
128





