idea 整合ssm问题

一个纠结了一天的问题,idea整合ssm,在使用mybatis的时候,总是提示容器无法加载dao,开始搜索无法加载dao层怎么办;

然后检查了所有的注解和代码,并没有发现什么代码错误。

然后仔细查看分析了一下我的log日志,把错误都挑出来了,发现所有的错误都有pagehelper,然后猜测是它的问题,教程里是4.1.6,但是maven导入不进去,它自己无法下载,然后就是了4.1.5,可以下载,顺便也下载了jsphelper0.9.5,因为看网上说这俩要一起用。然后试了一下重新发布!成功!

版本号杀我,阿弥陀佛

03-Oct-2019 21:36:55.220 警告 [RMI TCP Connection(3)-127.0.0.1] org.springframework.web.context.support.XmlWebApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userFunctionImpl': Unsatisfied dependency expressed through field 'uDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in file [D:\IDEA\workSpace\VIP\target\VIP\WEB-INF\classes\com\leilin\vip\dao\UserDao.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.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
03-Oct-2019 21:36:55.228 严重 [RMI TCP Connection(3)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed
 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userFunctionImpl': Unsatisfied dependency expressed through field 'uDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in file [D:\IDEA\workSpace\VIP\target\VIP\WEB-INF\classes\com\leilin\vip\dao\UserDao.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.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
	
	
Caused by: org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'userDao' defined in file 
[D:\IDEA\workSpace\VIP\target\VIP\WEB-INF\classes\com\leilin\vip\dao\UserDao.class]: 
Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.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
	
	
Caused by: org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-context.xml]: 
Invocation of init method failed;
 nested exception is org.springframework.core.NestedIOException: 
 Failed to parse config resource: class path resource [mybatis-config.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
	
	
Caused by: org.springframework.core.NestedIOException: 
Failed to parse config resource: class path resource [mybatis-config.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
	
	
Caused by: 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
	
	
Caused by: java.lang.ClassCastException: 
com.github.pagehelper.PageHelper cannot be cast to org.apache.ibatis.plugin.Interceptor
	
	

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值