线下一直报这个错误,不知道为什么,在网上搜看教程说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(<generated>)
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]
jdbc连接 :
具体报错在这里:
在这个地方报错。
断点看了,这个执行完之后插入成功了,但是放行之后就会报上面的错。