2019-12-17 12:43:20.834 ERROR 4644 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'asyncTaskServiceImpl': Injection of resource dependencies failed;
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mailServiceImpl' defined in URL [jar:file:/D:/Projects/github/presevere/presevere-server/target/presevere-server-1.0.0.jar!/BOOT-INF/classes!/cn/gmwenterprise/presevere/service/impl/MailServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemConfig': Injection of resource dependencies failed;
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysUserMapper' defined in URL [jar:file:/D:/Projects/github/presevere/presevere-server/target/presevere-server-1.0.0.jar!/BOOT-INF/classes!/cn/gmwenterprise/presevere/dao/SysUserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception;
nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [mappers/]';
nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 文件提前结束。
以上就是异常栈的主要信息,从中我现在已经看不出任何有效信息了。
怀疑过mappers文件夹中mapper.xml的编码问题,经vscode、notepad++等工具检查确认了编码的确是UTF-8 with NO BOM,所有mapper都是generate生成的,打包用的jdk试过了8和11,都一样会报这个错。
这张图片是打包时的信息,可见打包过程中的test也是OK的。
delete from sys_user_role where user_id not in ( ?, ?, ? )
其中这一行代码是我写在一个Configuration中的,是为了方便测试时清除无效数据使用,这个代码就是调用了mapper中的sql。
综上所述,求大佬救命!!!
看一下是不是这个问题 https://blog.csdn.net/u012012240/article/details/51275971