springboot项目报错问题

线下一直报这个错误,不知道为什么,在网上搜看教程说jdbc加时区设置,我也加了,但是还是这样。

Unexpected error occurred invoking async method 'public void com.hyzk.business.web.bom.service.impl.AsyncServiceWork.createQcEqument(java.lang.Integer,com.hyzk.business.common.bean.vo.QRCodeVO)'.
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection: Cannot determine target DataSource for lookup key [null]
### The error may exist in file [D:\workspace\GitLab\tongfei\mini-mes\target\classes\mybatis\web\bom\CpPartMapper.xml]
### The error may involve com.hyzk.business.web.bom.dao.PartMapper.insertQrCode
### The error occurred while executing an update
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection: Cannot determine target DataSource for lookup key [null]
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
    at com.sun.proxy.$Proxy128.insert(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
    at com.sun.proxy.$Proxy200.insertQrCode(Unknown Source)
    at com.hyzk.business.web.bom.service.impl.AsyncServiceWork.createQcEqument(AsyncServiceWork.java:28)
    at com.hyzk.business.web.bom.service.impl.AsyncServiceWork$$FastClassBySpringCGLIB$$df235708.invoke()
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection: Cannot determine target DataSource for lookup key [null]
### The error may exist in file [D:\workspace\GitLab\tongfei\mini-mes\target\classes\mybatis\web\bom\CpPartMapper.xml]
### The error may involve com.hyzk.business.web.bom.dao.PartMapper.insertQrCode
### The error occurred while executing an update
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection: Cannot determine target DataSource for lookup key [null]
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
    ... 15 common frames omitted
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection: Cannot determine target DataSource for lookup key [null]

把数据库配置那一段的代码也贴出来

解决方案:
1.检查数据库连接配置,确保正确地配置了数据源信息。
2.检查数据库端口是否正确。
3.确认数据库是否开启/启动。
4.确认数据库用户名和密码是否正确。
5.如果以上步骤仍然不能解决问题,可以检测防火墙是否阻挡了连接

img


数据库一直没有问题,报错显示在这里

img