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

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.mybatisgroupId>
    <artifactId>mybatisartifactId>
    <version>3.4.5version>
dependency>

你可能感兴趣的:(SSM框架,Java,Web)