1

Why is this error happening? I'm using freemarker-2.3.20 and spring-webmvc-3.2.17

 Caused by: 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:114)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
        ... 58 more
andolsi zied
  • 3,553
  • 2
  • 32
  • 43
zeji
  • 165
  • 1
  • 3
  • 10

1 Answers1

4

According to maven dependency, spring-webmvc-3.2.17 compiled with the version 2.3.20 of freemarker. So you you have to use this version to ommit conflicts.

Updated : link updated

It seems to me that FreeMarkerConfigurationFactory looks for a Configuration constructor with the version parameter, this has been added in the version 2.3.21 of freemarker. I think the spring version you mentioned is not good. Your are probably used a version greater than 4.1.5.RELEASE.

Community
  • 1
  • 1
andolsi zied
  • 3,553
  • 2
  • 32
  • 43