Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: DEFAULT_INCOMPATIB

这类错误一般出现在整合项目包的时候,解决方法最好是打开源代码

org.springframework.ui.freemarker.FreeMarkerConfigurationFactory

protected Configuration newConfiguration() throws IOException, TemplateException {
  return new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
 }

通过点击进入源代码发现Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS并没有定义,原因只有一个,检查包冲突,发现freemarker版本冲突,使用了旧版

Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: DEFAULT_INCOMPATIB_第1张图片

解决方法是将依赖包找到进行冲突排查


你可能感兴趣的:(Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: DEFAULT_INCOMPATIB)