question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
dutrieuxcommented, Sep 21, 2017

@leefinechan to solve problem just modify the anotation of the interceptor (by add Integer.class) like this :

@Intercepts({ @Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class, Integer.class }) })
4reactions
kazuki43zoocommented, Apr 20, 2016

@qmdx

In 3.4.0, StatementHandler#prepare(Connection) has been changed to StatementHandler#prepare(Connection,Integer).

See https://github.com/mybatis/mybatis-3/blob/master/src/main/java/org/apache/ibatis/executor/statement/StatementHandler.java#L33-L34 .

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found