D:\software\Java\jdk1.8\bin\java.exe "-javaagent:D:\software\IntelliJ IDEA 2018.3.2\lib\idea_rt.jar=55270:D:\software\IntelliJ IDEA 2018.3.2\bin" -Dfile.encoding=UTF-8 -classpath D:\software\Java\jdk1.8\jre\lib\charsets.jar;D:\software\Java\jdk1.8\jre\lib\deploy.jar;D:\software\Java\jdk1.8\jre\lib\ext\access-bridge-64.jar;D:\software\Java\jdk1.8\jre\lib\ext\cldrdata.jar;D:\software\Java\jdk1.8\jre\lib\ext\dnsns.jar;D:\software\Java\jdk1.8\jre\lib\ext\jaccess.jar;D:\software\Java\jdk1.8\jre\lib\ext\jfxrt.jar;D:\software\Java\jdk1.8\jre\lib\ext\localedata.jar;D:\software\Java\jdk1.8\jre\lib\ext\nashorn.jar;D:\software\Java\jdk1.8\jre\lib\ext\sunec.jar;D:\software\Java\jdk1.8\jre\lib\ext\sunjce_provider.jar;D:\software\Java\jdk1.8\jre\lib\ext\sunmscapi.jar;D:\software\Java\jdk1.8\jre\lib\ext\sunpkcs11.jar;D:\software\Java\jdk1.8\jre\lib\ext\zipfs.jar;D:\software\Java\jdk1.8\jre\lib\javaws.jar;D:\software\Java\jdk1.8\jre\lib\jce.jar;D:\software\Java\jdk1.8\jre\lib\jfr.jar;D:\software\Java\jdk1.8\jre\lib\jfxswt.jar;D:\software\Java\jdk1.8\jre\lib\jsse.jar;D:\software\Java\jdk1.8\jre\lib\management-agent.jar;D:\software\Java\jdk1.8\jre\lib\plugin.jar;D:\software\Java\jdk1.8\jre\lib\resources.jar;D:\software\Java\jdk1.8\jre\lib\rt.jar;D:\code\web_spring\spring_mybatis_test\myabtis_test\target\classes;D:\software\maven-repository\org\springframework\spring-context\5.1.9.RELEASE\spring-context-5.1.9.RELEASE.jar;D:\software\maven-repository\org\springframework\spring-aop\5.1.9.RELEASE\spring-aop-5.1.9.RELEASE.jar;D:\software\maven-repository\org\springframework\spring-beans\5.1.9.RELEASE\spring-beans-5.1.9.RELEASE.jar;D:\software\maven-repository\org\springframework\spring-core\5.1.9.RELEASE\spring-core-5.1.9.RELEASE.jar;D:\software\maven-repository\org\springframework\spring-jcl\5.1.9.RELEASE\spring-jcl-5.1.9.RELEASE.jar;D:\software\maven-repository\org\springframework\spring-expression\5.1.9.RELEASE\spring-expression-5.1.9.RELEASE.jar;D:\software\maven-repository\org\springframework\spring-test\5.1.9.RELEASE\spring-test-5.1.9.RELEASE.jar;D:\software\maven-repository\org\springframework\spring-jdbc\5.1.9.RELEASE\spring-jdbc-5.1.9.RELEASE.jar;D:\software\maven-repository\org\springframework\spring-tx\5.1.9.RELEASE\spring-tx-5.1.9.RELEASE.jar;D:\software\maven-repository\org\mybatis\mybatis\3.5.3\mybatis-3.5.3.jar;D:\software\maven-repository\org\mybatis\mybatis-spring\1.2.2\mybatis-spring-1.2.2.jar;D:\software\maven-repository\com\alibaba\druid\1.1.21\druid-1.1.21.jar;D:\software\maven-repository\mysql\mysql-connector-java\5.1.48\mysql-connector-java-5.1.48.jar;D:\software\maven-repository\junit\junit\4.12\junit-4.12.jar;D:\software\maven-repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar App
七月 19, 2020 5:12:27 下午 com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl info
信息: {dataSource-1} inited
Exception in thread "main" java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer;
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:87)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.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.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
at com.sun.proxy.$Proxy8.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:163)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:87)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:93)
at com.sun.proxy.$Proxy9.fundById(Unknown Source)
at com.itheima.service.impl.AccountServiceImpl.checkAccount(AccountServiceImpl.java:17)
at App.main(App.java:11)
Process finished with exit code 1
出现这个错误的原因主要是spring-mybatis和mybatis版本不匹配,产生冲突的原因
<!--mybatis-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.3</version>
</dependency>
<!--mybatis-spring-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
这套依赖版本不会出现错误,其他版本未试。