Caused by: java.lang.NoSuchMethodError: freemarker.template.Configuration.(Lfreemarker/templat

spring boot 2.0 版本启动报错

Caused by: java.lang.NoSuchMethodError: freemarker.template.Configuration.(Lfreemarker/template/Version;)V
	at org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.newConfiguration(FreeMarkerConfigurationFactory.java:328)
	at org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.createConfiguration(FreeMarkerConfigurationFactory.java:258)
	at org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer.afterPropertiesSet(FreeMarkerConfigurer.java:120)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1767)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1704)
	... 16 common frames omitted

原因是使用的freemark 版本不对,我的是: 
        
            org.freemarker
            freemarker
            2.3.20
        

后改为:

        
            org.freemarker
            freemarker
            2.3.28
        
就正常了


你可能感兴趣的:(spring,boot)