Mybatis整合Spring 由于版本引起的BUG问题
错误信息:
org.apache.catalina.core.StandardWrapperValve.invokeServlet.service()forservlet[SpringMVC]incontextwithpath[/tech]threwexception[Handlerdispatchfailed;nestedexceptionisjava.lang.AbstractMethodError:org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer;]withrootcause java.lang.AbstractMethodError:org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer; atorg.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85) atorg.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) atorg.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) atorg.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) atorg.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) atcom.github.pagehelper.util.SqlUtil.doIntercept(SqlUtil.java:146) atcom.github.pagehelper.util.SqlUtil.intercept(SqlUtil.java:84) atcom.github.pagehelper.PageHelper.intercept(PageHelper.java:50) atorg.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) atcom.sun.proxy.$Proxy23.query(UnknownSource) atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod) atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) atjava.lang.reflect.Method.invoke(Method.java:498) atorg.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:408) atcom.sun.proxy.$Proxy13.selectList(UnknownSource) atorg.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:206) atcom.spec.dao.DaoSupport.findForList(DaoSupport.java:122) atcom.spec.services.system.log.impl.LogServiceImpl.list(LogServiceImpl.java:22) atcom.spec.services.system.log.impl.LogServiceImpl FastClassBySpringCGLIB 9d5e180.invoke() atorg.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) atorg.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) atorg.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) atorg.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) atorg.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) atorg.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) atorg.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) atcom.spec.services.system.log.impl.LogServiceImpl EnhancerBySpringCGLIB 85235142.list( ) atcom.spec.controller.system.LogController.list(LogController.java:34) atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod) atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) atjava.lang.reflect.Method.invoke(Method.java:498) atorg.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) atorg.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) atorg.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) atorg.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) atorg.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) atorg.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) atorg.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) atorg.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) atorg.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) atorg.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) atjavax.servlet.http.HttpServlet.service(HttpServlet.java:635) atorg.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) atjavax.servlet.http.HttpServlet.service(HttpServlet.java:742) atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) atorg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) atorg.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) atorg.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) atorg.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) atorg.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) atorg.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) atorg.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) atorg.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) atorg.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) atorg.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) atjava.lang.Thread.run(Thread.java:745)
Jar包版本:
org.mybatis mybatis ${mybatis.version} org.mybatis mybatis-spring ${mybatis.spring.version} 1.2.5 3.4.0
解决方案:
将mybatis-spring版本有1.2.5改成1.3.0.
以上所述是小编给大家介绍的Mybatis整合Spring由于版本引起的BUG问题,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!