sharding-proxy加入seata做分表操作

方便更快捷的说明问题,可以按需填写(可删除)

使用环境:

springcloud alibaba + nacos + seata + sharding-proxy5.1.1

场景、问题:

springcloud alibaba + nacos + seata 环境的时候,使用seata做的分布式事务,现在有一个库的表数据量比较大,现在使用sharding-proxy5.1.1进行分表,之前使用的@GlobalTransactional 所有的注解插入都不好使

已进行操作:

参考咱们的 ShardingSphere-Proxy Base 事务基于 Seata 验证做的配置操作,启动也正常启动,而且nacos中已经能看见sharding-proxy了。

现状:

依旧还是不好用,报错如下:
io.seata.rm.datasource.sql.struct.cache.AbstractTableMetaCache [63] -| get table meta error:This version of ShardingSphere-Proxy doesn’t yet support this SQL. ‘You have an error in your SQL syntax’

你输入的 SQL 不能被正确解析,请提供该 SQL 语句。

您好,sql就是简单的update,而且还不是分表的update,之前没有整合sharding-proxy的时候代码都是正常的,只不过都是@GlobalTransactional的sql就都不好用了,sharding-proxy没有错误日志,应用的错误日式如下:
io.seata.rm.datasource.sql.struct.cache.AbstractTableMetaCache [63] -| get table meta error:This version of ShardingSphere-Proxy doesn’t yet support this SQL. ‘You have an error in your SQL syntax’

get table meta error ,显然是 seata 发送的获取元数据的 SQL 语句,而非你自己的业务 SQL。
要获取这条 SQL 语句的内容,可以在 Proxy 的 logback.xml 中将 shardingsphere 设置到 debug 级别,这样所有的报文会被打印到日志中。
由于是 SQL 解析的异常,在你能提供 SQL 语句之前,这个问题确实无人能够解答。

好的,我再试一下

2022-04-19 13:09:52.213 |-ERROR [http-nio-8720-exec-4] io.seata.rm.datasource.sql.struct.cache.AbstractTableMetaCache [63] -| get table meta error:This version of ShardingSphere-Proxy doesn’t yet support this SQL. ‘You have an error in your SQL syntax’
java.sql.SQLSyntaxErrorException: This version of ShardingSphere-Proxy doesn’t yet support this SQL. ‘You have an error in your SQL syntax’
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1200)
at com.mysql.cj.jdbc.DatabaseMetaData$6.forEach(DatabaseMetaData.java:2717)
at com.mysql.cj.jdbc.DatabaseMetaData$6.forEach(DatabaseMetaData.java:2704)
at com.mysql.cj.jdbc.IterateBlock.doForAll(IterateBlock.java:56)
at com.mysql.cj.jdbc.DatabaseMetaData.getIndexInfo(DatabaseMetaData.java:2774)
at io.seata.rm.datasource.sql.struct.cache.MysqlTableMetaCache.resultSetMetaToSchema(MysqlTableMetaCache.java:117)
at io.seata.rm.datasource.sql.struct.cache.MysqlTableMetaCache.fetchSchema(MysqlTableMetaCache.java:82)
at io.seata.rm.datasource.sql.struct.cache.AbstractTableMetaCache.lambda$getTableMeta$0(AbstractTableMetaCache.java:61)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2343)
at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2341)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2324)
at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108)
at com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62)
at io.seata.rm.datasource.sql.struct.cache.AbstractTableMetaCache.getTableMeta(AbstractTableMetaCache.java:59)
at io.seata.rm.datasource.exec.BaseTransactionalExecutor.getTableMeta(BaseTransactionalExecutor.java:215)
at io.seata.rm.datasource.exec.BaseTransactionalExecutor.getTableMeta(BaseTransactionalExecutor.java:200)
at io.seata.rm.datasource.exec.UpdateExecutor.beforeImage(UpdateExecutor.java:70)
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.executeAutoCommitFalse(AbstractDMLBaseExecutor.java:101)
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.lambda$executeAutoCommitTrue$2(AbstractDMLBaseExecutor.java:142)
at io.seata.rm.datasource.ConnectionProxy$LockRetryPolicy.doRetryOnLockConflict(ConnectionProxy.java:302)
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor$LockRetryPolicy.execute(AbstractDMLBaseExecutor.java:186)
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.executeAutoCommitTrue(AbstractDMLBaseExecutor.java:141)
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.doExecute(AbstractDMLBaseExecutor.java:84)
at io.seata.rm.datasource.exec.BaseTransactionalExecutor.execute(BaseTransactionalExecutor.java:113)
at io.seata.rm.datasource.exec.ExecuteTemplate.execute(ExecuteTemplate.java:111)
at io.seata.rm.datasource.exec.ExecuteTemplate.execute(ExecuteTemplate.java:50)
at io.seata.rm.datasource.PreparedStatementProxy.execute(PreparedStatementProxy.java:55)
at sun.reflect.GeneratedMethodAccessor183.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
at com.sun.proxy.$Proxy482.execute(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
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.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
at com.sun.proxy.$Proxy480.update(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
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:434)
at com.sun.proxy.$Proxy152.update(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:295)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:59)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
at com.sun.proxy.$Proxy200.updateByPrimaryKeySelective(Unknown Source)
at com.roncoo.education.user.service.dao.impl.UserDaoImpl.updateById(UserDaoImpl.java:61)
at com.roncoo.education.user.service.dao.impl.UserDaoImpl$$FastClassBySpringCGLIB$$585e123c.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at com.roncoo.education.user.service.dao.impl.UserDaoImpl$$EnhancerBySpringCGLIB$$49712995.updateById()
at com.roncoo.education.user.service.api.biz.ApiUserInfoBiz.auth(ApiUserInfoBiz.java:695)
at com.roncoo.education.user.service.api.biz.ApiUserInfoBiz$$FastClassBySpringCGLIB$$8a558176.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at io.seata.spring.annotation.GlobalTransactionalInterceptor$2.execute(GlobalTransactionalInterceptor.java:184)
at io.seata.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:127)
at io.seata.spring.annotation.GlobalTransactionalInterceptor.handleGlobalTransaction(GlobalTransactionalInterceptor.java:181)
at io.seata.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:150)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at com.roncoo.education.user.service.api.biz.ApiUserInfoBiz$$EnhancerBySpringCGLIB$$befd9692.auth()
at com.roncoo.education.user.service.api.ApiUserInfoController.auth(ApiUserInfoController.java:46)
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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
2022-04-19 13:09:52.225 |-ERROR [http-nio-8720-exec-4] io.seata.rm.datasource.exec.AbstractDMLBaseExecutor [148] -| execute executeAutoCommitTrue error:[xid:172.26.76.38:8091:259668485490237440]get tablemeta failed
io.seata.common.exception.ShouldNeverHappenException: [xid:172.26.76.38:8091:259668485490237440]get tablemeta failed
at io.seata.rm.datasource.sql.struct.cache.AbstractTableMetaCache.getTableMeta(AbstractTableMetaCache.java:69)
at io.seata.rm.datasource.exec.BaseTransactionalExecutor.getTableMeta(BaseTransactionalExecutor.java:215)
at io.seata.rm.datasource.exec.BaseTransactionalExecutor.getTableMeta(BaseTransactionalExecutor.java:200)
at io.seata.rm.datasource.exec.UpdateExecutor.beforeImage(UpdateExecutor.java:70)
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.executeAutoCommitFalse(AbstractDMLBaseExecutor.java:101)
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.lambda$executeAutoCommitTrue$2(AbstractDMLBaseExecutor.java:142)
at io.seata.rm.datasource.ConnectionProxy$LockRetryPolicy.doRetryOnLockConflict(ConnectionProxy.java:302)
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor$LockRetryPolicy.execute(AbstractDMLBaseExecutor.java:186)
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.executeAutoCommitTrue(AbstractDMLBaseExecutor.java:141)
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.doExecute(AbstractDMLBaseExecutor.java:84)
at io.seata.rm.datasource.exec.BaseTransactionalExecutor.execute(BaseTransactionalExecutor.java:113)
at io.seata.rm.datasource.exec.ExecuteTemplate.execute(ExecuteTemplate.java:111)
at io.seata.rm.datasource.exec.ExecuteTemplate.execute(ExecuteTemplate.java:50)
at io.seata.rm.datasource.PreparedStatementProxy.execute(PreparedStatementProxy.java:55)
at sun.reflect.GeneratedMethodAccessor183.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
at com.sun.proxy.$Proxy482.execute(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
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.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
at com.sun.proxy.$Proxy480.update(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
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:434)
at com.sun.proxy.$Proxy152.update(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:295)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:59)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
at com.sun.proxy.$Proxy200.updateByPrimaryKeySelective(Unknown Source)
at com.roncoo.education.user.service.dao.impl.UserDaoImpl.updateById(UserDaoImpl.java:61)
at com.roncoo.education.user.service.dao.impl.UserDaoImpl$$FastClassBySpringCGLIB$$585e123c.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at com.roncoo.education.user.service.dao.impl.UserDaoImpl$$EnhancerBySpringCGLIB$$49712995.updateById()
at com.roncoo.education.user.service.api.biz.ApiUserInfoBiz.auth(ApiUserInfoBiz.java:695)
at com.roncoo.education.user.service.api.biz.ApiUserInfoBiz$$FastClassBySpringCGLIB$$8a558176.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at io.seata.spring.annotation.GlobalTransactionalInterceptor$2.execute(GlobalTransactionalInterceptor.java:184)
at io.seata.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:127)
at io.seata.spring.annotation.GlobalTransactionalInterceptor.handleGlobalTransaction(GlobalTransactionalInterceptor.java:181)
at io.seata.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:150)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at com.roncoo.education.user.service.api.biz.ApiUserInfoBiz$$EnhancerBySpringCGLIB$$befd9692.auth()
at com.roncoo.education.user.service.api.ApiUserInfoController.auth(ApiUserInfoController.java:46)
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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
这个是应用的全部异常,我是新用户上传不了文件,开启debug以后,proxy的日志如下:

链接: 百度网盘 请输入提取码 提取码: bq08
–来自百度网盘超级会员v7的分享

@mazhai
你好,提供的日志文件中没有包含你描述的解析异常。

整个文件只有另一个 Exception:

[DEBUG] 2022-04-19 13:13:01.817 [Connection-1-ThreadExecutor] o.a.s.p.f.m.c.MySQLCommandExecutorFactory - Execute packet type: COM_QUERY, value: MySQLComQueryPacket(sql=commit)
Exception in thread "Connection-1-ThreadExecutor" java.lang.AbstractMethodError: org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager.commit(Z)V
	at org.apache.shardingsphere.proxy.backend.communication.jdbc.transaction.JDBCBackendTransactionManager.commit(JDBCBackendTransactionManager.java:78)
	at org.apache.shardingsphere.proxy.backend.communication.jdbc.transaction.JDBCBackendTransactionManager.commit(JDBCBackendTransactionManager.java:37)
	at org.apache.shardingsphere.proxy.backend.text.transaction.TransactionBackendHandler.execute(TransactionBackendHandler.java:120)
	at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:97)

这个问题建议另行调查吧,你能在 debug 时重现最初的问题吗?

嗯,之前的项目有点儿太大了,我自己再搭一个简单的环境试一下

[DEBUG] 2022-05-02 18:48:21.777 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Read from client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 1d 00 00 00 03 53 45 4c 45 43 54 20 2a 20 46 52 |…SELECT * FR|
|00000010| 4f 4d 20 74 65 73 74 5f 61 20 4c 49 4d 49 54 20 |OM test_a LIMIT |
|00000020| 31 |1 |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.778 [Connection-1-ThreadExecutor] o.a.s.p.f.m.c.MySQLCommandExecutorFactory - Execute packet type: COM_QUERY, value: MySQLComQueryPacket(sql=SELECT * FROM test_a LIMIT 1)
[INFO ] 2022-05-02 18:48:21.780 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Logic SQL: SELECT * FROM test_a LIMIT 1
[INFO ] 2022-05-02 18:48:21.780 [Connection-1-ThreadExecutor] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(table=Optional.empty, limit=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.LimitSegment@311e7617], lock=Optional.empty, window=Optional.empty)
[INFO ] 2022-05-02 18:48:21.780 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: SELECT * FROM test_a LIMIT 1
[DEBUG] 2022-05-02 18:48:21.782 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 01 00 00 01 02 |… |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.782 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 25 00 00 02 03 64 65 66 0b 73 68 61 72 64 69 6e |%…def.shardin|
|00000010| 67 5f 64 62 00 00 02 69 64 02 69 64 0c 21 00 14 |g_db…id.id.!..|
|00000020| 00 00 00 08 01 00 00 00 00 |… |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.782 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 33 00 00 03 03 64 65 66 0b 73 68 61 72 64 69 6e |3…def.shardin|
|00000010| 67 5f 64 62 00 00 09 75 73 65 72 5f 6e 61 6d 65 |g_db…user_name|
|00000020| 09 75 73 65 72 5f 6e 61 6d 65 0c 21 00 ff 00 00 |.user_name.!..|
|00000030| 00 fd 20 00 00 00 00 |… … |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.782 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 05 00 00 04 fe 00 00 02 00 |… |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.782 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 06 00 00 05 01 31 03 6d 7a 36 |…1.mz6 |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.782 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 05 00 00 06 fe 00 00 02 00 |… |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.783 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Read from client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 2c 00 00 00 03 53 48 4f 57 20 46 55 4c 4c 20 54 |,…SHOW FULL T|
|00000010| 41 42 4c 45 53 20 46 52 4f 4d 20 60 73 68 61 72 |ABLES FROM shar| |00000020| 64 69 6e 67 5f 64 62 60 20 4c 49 4b 45 20 27 27 |ding_db LIKE ‘’|
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.784 [Connection-1-ThreadExecutor] o.a.s.p.f.m.c.MySQLCommandExecutorFactory - Execute packet type: COM_QUERY, value: MySQLComQueryPacket(sql=SHOW FULL TABLES FROM sharding_db LIKE ‘’)
[DEBUG] 2022-05-02 18:48:21.785 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 01 00 00 01 02 |… |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.786 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 4b 00 00 02 03 64 65 66 0b 73 68 61 72 64 69 6e |K…def.shardin|
|00000010| 67 5f 64 62 00 00 15 54 61 62 6c 65 73 5f 69 6e |g_db…Tables_in|
|00000020| 5f 73 68 61 72 64 69 6e 67 5f 64 62 15 54 61 62 |sharding_db.Tab|
|00000030| 6c 65 73 5f 69 6e 5f 73 68 61 72 64 69 6e 67 5f |les_in_sharding
|
|00000040| 64 62 0c 21 00 ff 00 00 00 fd 20 00 00 00 00 |db.!.. … |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.786 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 35 00 00 03 03 64 65 66 0b 73 68 61 72 64 69 6e |5…def.shardin|
|00000010| 67 5f 64 62 00 00 0a 54 61 62 6c 65 5f 74 79 70 |g_db…Table_typ|
|00000020| 65 0a 54 61 62 6c 65 5f 74 79 70 65 0c 21 00 14 |e.Table_type.!..|
|00000030| 00 00 00 fd 20 00 00 00 00 |… … |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.786 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 05 00 00 04 fe 00 00 02 00 |… |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.787 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 05 00 00 05 fe 00 00 02 00 |… |
±-------±------------------------------------------------±---------------+
[DEBUG] 2022-05-02 18:48:21.788 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Read from client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 26 00 00 00 03 53 48 4f 57 20 49 4e 44 45 58 20 |&…SHOW INDEX |
|00000010| 46 52 4f 4d 20 60 60 20 46 52 4f 4d 20 60 73 68 |FROM FROM `sh| |00000020| 61 72 64 69 6e 67 5f 64 62 60 |arding_db` | +--------+-------------------------------------------------+----------------+ [DEBUG] 2022-05-02 18:48:21.789 [Connection-1-ThreadExecutor] o.a.s.p.f.m.c.MySQLCommandExecutorFactory - Execute packet type: COM_QUERY, value: MySQLComQueryPacket(sql=SHOW INDEX FROM FROM sharding_db)
[DEBUG] 2022-05-02 18:48:21.791 [nioEventLoopGroup-3-1] o.a.s.db.protocol.codec.PacketCodec - Write to client dd1cd854 :
±------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
±-------±------------------------------------------------±---------------+
|00000000| 72 00 00 01 ff d3 04 23 34 32 30 30 30 54 68 69 |r…#42000Thi|
|00000010| 73 20 76 65 72 73 69 6f 6e 20 6f 66 20 53 68 61 |s version of Sha|
|00000020| 72 64 69 6e 67 53 70 68 65 72 65 2d 50 72 6f 78 |rdingSphere-Prox|
|00000030| 79 20 64 6f 65 73 6e 27 74 20 79 65 74 20 73 75 |y doesn’t yet su|
|00000040| 70 70 6f 72 74 20 74 68 69 73 20 53 51 4c 2e 20 |pport this SQL. |
|00000050| 27 59 6f 75 20 68 61 76 65 20 61 6e 20 65 72 72 |‘You have an err|
|00000060| 6f 72 20 69 6e 20 79 6f 75 72 20 53 51 4c 20 73 |or in your SQL s|
|00000070| 79 6e 74 61 78 27 |yntax’ |
±-------±------------------------------------------------±---------------+

搭建了个简单的环境还是报错

SHOW INDEX FROM FROM sharding_db 这条 SQL 中多了一个 FROM

1 个赞
京ICP备2021015875号