mybatis3.4.0 error
See original GitHub issue@Intercepts({ @Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class }) })
public class PaginationInterceptor implements Interceptor {......}
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
### Error opening session. Cause: org.apache.ibatis.plugin.PluginException: Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.statement.StatementHandler.prepare(java.sql.Connection)
### Cause: org.apache.ibatis.plugin.PluginException: Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.statement.StatementHandler.prepare(java.sql.Connection)
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:100)
at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:47)
at com.baomidou.mybatisplus.test.UserMapperTest.main(UserMapperTest.java:73)
Caused by: org.apache.ibatis.plugin.PluginException: Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.statement.StatementHandler.prepare(java.sql.Connection)
at org.apache.ibatis.plugin.Plugin.getSignatureMap(Plugin.java:87)
at org.apache.ibatis.plugin.Plugin.wrap(Plugin.java:44)
at com.baomidou.mybatisplus.plugins.PaginationInterceptor.plugin(PaginationInterceptor.java:185)
at org.apache.ibatis.plugin.InterceptorChain.pluginAll(InterceptorChain.java:31)
at org.apache.ibatis.session.Configuration.newExecutor(Configuration.java:546)
at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:96)
... 2 more
Caused by: java.lang.NoSuchMethodException: org.apache.ibatis.executor.statement.StatementHandler.prepare(java.sql.Connection)
at java.lang.Class.getMethod(Class.java:1605)
at org.apache.ibatis.plugin.Plugin.getSignatureMap(Plugin.java:84)
... 7 more
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
MyBatis 3 | Logging
Logging. MyBatis provides logging information through the use of an internal log factory. The internal log factory will delegate logging ...
Read more >Spring 3 and MyBatis 3.0.4 / 3.0.6 - Stack Overflow
I am trying to use Spring 3.0.5.RELEASE together with MyBatis in a Maven environment. I added the mybatis-spring dependency. This turned out not ......
Read more >Re: Connection time out error - Google Groups
Hi,. I am getting following exception while trying to connect to Netezza database using spring-mybatis. Related cause: org.springframework.beans.factory.
Read more >5.2. Database Access (MyBatis3) - terasoluna.org
Processes (4) to (10) mentioned below correspond to this type. ... An error may occur when setting the column value to null for...
Read more >The content of element type "resultMap" must match ... - 博客园
MyBatis3 association error - The content of element type "resultMap" ... 3.0//EN" 3 "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 4 <mapper ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@leefinechan to solve problem just modify the anotation of the interceptor (by add
Integer.class
) like this :@qmdx
In 3.4.0,
StatementHandler#prepare(Connection)
has been changed toStatementHandler#prepare(Connection,Integer)
.See https://github.com/mybatis/mybatis-3/blob/master/src/main/java/org/apache/ibatis/executor/statement/StatementHandler.java#L33-L34 .