Error handling after mybatis custom paging plug-in

error message

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)

In fact, carefully read the error prompts, trace to the source code to see the reason, because the use of a relatively new or the latest mybatis   Jar package, and my interceptor code is written in an old way. In the new mybatis jar package, the prepare method in statementhandler has two parameters, as follows: statement   prepare(Connection   connection,   Integer   Transaction timeout), but there is only one parameter in my interceptor code, so I can’t get it. The solution is to add an integer. Class parameter to the rules of pagination interceptor. As follows:

@Intercepts({@Signature(type=StatementHandler.class,method="prepare",args={Connection.class, Integer.class })})

 

Read More: