欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Mybatis整合Spring 由于版本引起的BUG问题

程序员文章站 2024-02-14 11:00:16
错误信息: org.apache.catalina.core.standardwrappervalve.invoke servlet.service() for...

错误信息:

org.apache.catalina.core.standardwrappervalve.invoke servlet.service() for servlet [springmvc] in context with path [/tech] threw exception [handler dispatch failed; nested exception is java.lang.abstractmethoderror: org.mybatis.spring.transaction.springmanagedtransaction.gettimeout()ljava/lang/integer;] with root cause 
java.lang.abstractmethoderror: org.mybatis.spring.transaction.springmanagedtransaction.gettimeout()ljava/lang/integer; 
at org.apache.ibatis.executor.simpleexecutor.preparestatement(simpleexecutor.java:85) 
at org.apache.ibatis.executor.simpleexecutor.doquery(simpleexecutor.java:62) 
at org.apache.ibatis.executor.baseexecutor.queryfromdatabase(baseexecutor.java:325) 
at org.apache.ibatis.executor.baseexecutor.query(baseexecutor.java:156) 
at org.apache.ibatis.executor.cachingexecutor.query(cachingexecutor.java:109) 
at com.github.pagehelper.util.sqlutil.dointercept(sqlutil.java:146) 
at com.github.pagehelper.util.sqlutil.intercept(sqlutil.java:84) 
at com.github.pagehelper.pagehelper.intercept(pagehelper.java:50) 
at org.apache.ibatis.plugin.plugin.invoke(plugin.java:61) 
at com.sun.proxy.$proxy23.query(unknown source) 
at org.apache.ibatis.session.defaults.defaultsqlsession.selectlist(defaultsqlsession.java:148) 
at org.apache.ibatis.session.defaults.defaultsqlsession.selectlist(defaultsqlsession.java:141) 
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:408) 
at com.sun.proxy.$proxy13.selectlist(unknown source) 
at org.mybatis.spring.sqlsessiontemplate.selectlist(sqlsessiontemplate.java:206) 
at com.spec.dao.daosupport.findforlist(daosupport.java:122) 
at com.spec.services.system.log.impl.logserviceimpl.list(logserviceimpl.java:22) 
at com.spec.services.system.log.impl.logserviceimpl
fastclassbyspringcglib
9d5e180.invoke(<generated>) 
at org.springframework.cglib.proxy.methodproxy.invoke(methodproxy.java:204) 
at org.springframework.aop.framework.cglibaopproxy$cglibmethodinvocation.invokejoinpoint(cglibaopproxy.java:738) 
at org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:157) 
at org.springframework.transaction.interceptor.transactioninterceptor$1.proceedwithinvocation(transactioninterceptor.java:99) 
at org.springframework.transaction.interceptor.transactionaspectsupport.invokewithintransaction(transactionaspectsupport.java:282) 
at org.springframework.transaction.interceptor.transactioninterceptor.invoke(transactioninterceptor.java:96) 
at org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) 
at org.springframework.aop.interceptor.exposeinvocationinterceptor.invoke(exposeinvocationinterceptor.java:92) 
at org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) 
at org.springframework.aop.framework.cglibaopproxy$dynamicadvisedinterceptor.intercept(cglibaopproxy.java:673) 
at com.spec.services.system.log.impl.logserviceimpl
enhancerbyspringcglib
85235142.list(<generated>) 
at com.spec.controller.system.logcontroller.list(logcontroller.java:34) 
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:205) 
at org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:133) 
at org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:97) 
at org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlermethod(requestmappinghandleradapter.java:827) 
at org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:738) 
at org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:85) 
at org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:963) 
at org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:897) 
at org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:970) 
at org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:861) 
at javax.servlet.http.httpservlet.service(httpservlet.java:635) 
at org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:846) 
at javax.servlet.http.httpservlet.service(httpservlet.java:742) 
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:52) 
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:197) 
at org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) 
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:198) 
at org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:96) 
at org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:478) 
at org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:140) 
at org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:80) 
at org.apache.catalina.valves.abstractaccesslogvalve.invoke(abstractaccesslogvalve.java:624) 
at org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:87) 
at org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:342) 
at org.apache.coyote.http11.http11processor.service(http11processor.java:799) 
at org.apache.coyote.abstractprocessorlight.process(abstractprocessorlight.java:66) 
at org.apache.coyote.abstractprotocol$connectionhandler.process(abstractprotocol.java:861) 
at org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun(nioendpoint.java:1455) 
at org.apache.tomcat.util.net.socketprocessorbase.run(socketprocessorbase.java:49) 
at java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) 
at java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) 
at org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61) 
at java.lang.thread.run(thread.java:745) 

jar包版本:

<dependency> 
   <groupid>org.mybatis</groupid> 
   <artifactid>mybatis</artifactid> 
   <version>${mybatis.version}</version> 
  </dependency> 
  <dependency> 
   <groupid>org.mybatis</groupid> 
   <artifactid>mybatis-spring</artifactid> 
   <version>${mybatis.spring.version}</version> 
  </dependency> 
  <mybatis.spring.version>1.2.5</mybatis.spring.version> 
  <mybatis.version>3.4.0</mybatis.version> 

解决方案:

将mybatis-spring版本有1.2.5改成1.3.0.

以上所述是小编给大家介绍的mybatis整合spring 由于版本引起的bug问题,希望对大家有所帮助