Maven下SSM项目整合笔记03:整合项目遇到的错误合集

来源:互联网 发布:ubuntu登录界面 编辑:程序博客网 时间:2024/06/07 11:18

eclipse oxygen环境:
- 项目名报红叉,文件无错误提示:
– 打开window-》show view添加problems的视图
– 查看出现的错误

Description:Resource Path Location Type
Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project… from the project context menu or use Quick Fix. ssmweb line 1 Maven Configuration Problem
截图:
这里写图片描述

解决方法:项目右键maven-》update project选择需要更新的项目即可。回去界面看到红色错误消失。


  • 出现创建sqlSessionFactory的错误:

警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’: Failed to introspect bean class [org.mybatis.spring.SqlSessionFactoryBean] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/mapping/DatabaseIdProvider
这里是因为使用的mybatis版本的问题,之前错误引入了ibitis的包,这里删除这个依赖,在pom.xml中添加Mybatis的依赖:

<dependency>    <groupId>org.mybatis</groupId>    <artifactId>mybatis</artifactId>    <version>3.4.5</version></dependency>
原创粉丝点击