idea运行springboot项目没报错,打成jar包运行java.lang.IllegalArgumentException: name
解决方法:
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.bx.Application]; nested exception is java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration
Caused by: java.lang.IllegalArgumentException: name
原因是我在application.yml中配置freemaeker的template-loader-path属性写成了物理地址
F:/jianzhi/idea_items/all/src/main/webapp/,在idea中直接运行就可以,打成可执行jar包运行路径就有问题了。如果时前后端分离,后端可以远程调用ftl文件。远程加载freemarker模板请参考: