java.lang.ClassCastException: com.github.pagehelper.PageHelpercannot be cast to org.apache.Intercept


pagehelperプラグインの使用中に発生した異常.
私のmybatisの構成は以下の通りです.
  


	
		
        	
    	
	
	

異常:Error creating bean with name'sqlSessionFactory'defined in file[D:eclipse-workspace 2.metadata.pluginsorg.eclipse.wst.server.coretmp 0wtpwebappstaotao-manager-webWEB-INFclassesspringapplicationContext-dao.xml]:Invocation of init method failed;nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis/sqlSessionConfig.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.ClassCastException: com.github.pagehelper.PageHelper cannot be cast to org.apache.ibatis.plugin.Interceptor .
強制転換が成功しないという意味です.
原因分析:
5.1.2

私が使っているpagehelperのバージョンは5.1で、5.0以降のバージョンはcomを使っています.github.pagehelper.PageInterceptorというクラスです.
ソリューション:
mybatisプロファイルの

に改心
  


	
		
        	
    	
	
	

修正してからまた間違いが爆発した.
Error creating bean with name 'sqlSessionFactory' defined in file [D:\eclipse-workspace2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\taotao-manager-web\WEB-INF\classes\spring\applicationContext-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis/sqlSessionConfig.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: com.github.pagehelper.PageException: java.lang.ClassNotFoundException: mysql
エラーの情報は明らかで、oracleクラスは認識していません.最終的な原因はバージョンの問題で、4.0からです.0以降のバージョンでは、データベースが自動的に認識されるので、データベースを指定する必要はありません.そのため、構成を変更します.
  


	
		
        	
    	
	
	

問題が解決する.