1. 程式人生 > >spring mvc + freemarker配置報錯

spring mvc + freemarker配置報錯

java.lang.NoSuchMethodError: freemarker.template.Configuration.<init>(Lfreemarker/template/Version;)V
at org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.newConfiguration(FreeMarkerConfigurationFactory.java:320)
at org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.createConfiguration(FreeMarkerConfigurationFactory.java:250)
at org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer.afterPropertiesSet(FreeMarkerConfigurer.java:116)

at cn.com.qianhuoda.gongyinglian.shiro.ShiroTagFreeMarkerConfigurer.afterPropertiesSet(ShiroTagFreeMarkerConfigurer.java:14)

原始配置:

 <dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.20</version>

</dependency>

修改為:

<dependency>  
    <groupId>org.freemarker</groupId>  
    <artifactId>freemarker</artifactId>  
    <version>2.3.27-incubating</version>  

</dependency> 

錯誤解決。