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
    评论
要将bootstrap与ideaSSM整合,您需要执行以下步骤: 1. 下载Bootstrap的CSS和JS文件。您可以从官方网站下载或使用CDN。 2. 创建一个新的Maven项目,并将SpringMVC,MyBatis和其他所需的依赖项添加到pom.xml文件中。 3. 在项目中创建一个名为“webapp”的目录,并在该目录下创建一个名为“WEB-INF”的子目录。 4. 在“WEB-INF”目录下创建一个名为“views”的子目录,并在该目录下创建一个名为“index.jsp”的文件。该文件将是您的主页视图。 5. 在“index.jsp”文件中添加以下代码来引用Bootstrap的CSS和JS文件: ```html <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <!-- Bootstrap JS --> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNV3dt" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> ``` 6. 在SpringMVC配置文件中添加以下代码来指定视图的文件夹位置: ```xml <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/views/" /> <property name="suffix" value=".jsp" /> </bean> ``` 7. 运行应用程序并在浏览器中打开主页。您将看到Bootstrap的样式和组件已成功应用于您的应用程序。 通过这些步骤,您可以将Bootstrap整合ideaSSM项目中,从而为您的应用程序提供更好的外观和用户体验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值