下面是我这几天整合SpringMVC+Spring+MyBatis框架遇到的一些问题 ,在这里总结一下:

1:HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

问题是:数据库连接出错,一般是配置数据库连接的url、username、password或者是数据库连接失败

url配置:jdbc:mysql://数据库地址:端口号/数据库名?编码等    //如:url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8

2:HTTP Status 500 - Servlet.init() for servlet SpringMVC threw exception

....(此处省略上上重点错误,如下:)
root cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.service.UserService com.controller.UserController.userService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.service.UserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
问题是:业务层没有@Service注解
提示大概的意思是controller里的的UserService自动注入失败
 
3:[spring]启动时报错:NoSuchMethodError: javax.servlet.http.HttpServletResponse.getStatus()I

Spring V4.1.0+的版本在不支持Servlet3.0的应用服务器上跑时会报以下错误:

NoSuchMethodError: javax.servlet.http.HttpServletResponse.getStatus()I

比如说:tomcat 7以下的版本、jboss 4.2.3以下的版本

解决版本有两个(任意选一个即可):

1)、退回到Spring V4.0.7

2)、升级应用服务器到支持Servlet3的应用服务器。

比如tomcat7+(最好是tomcat8+)、jboss as 7+

 
4:java.lang.NoClassDefFoundError: org/springframework/core/MethodIntrospector$MetadataLookup
1)、我这里出现的问题好像是spring-core和其它包发生冲突了,我删了spring-core包后重启IDEA就可以了。
 
 
 
5:在使用Mbatis逆向工程的时间,运行时报:Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project shop: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Cannot resolve classpath entry: C:\Users\Administrator.SC-201810221720\.m2\repository\mysql\mysql-connector-java\5.1.27\mysql-connector-java-5.1.27.jar} -> [Help 1]
  大致意思应该是mysql驱动包连接不到。
  这里就是generatorConfig.xml文件中的classPathEntry路径配置错误,这里范了个很低级的错误,最后那里多了个方括号(“}”)

这个路径配置,通过下图直接copy path就ok了

IDEA搭建SSM出现的一些错误的更多相关文章

  1. Maven 搭建 SSM 项目 (oracle)

    简单谈一下maven搭建 ssm 项目 (使用数据库oracle,比 mysql 难,所以这里谈一下) 在创建maven 的web项目时,常常会缺了main/java , main/test 两个文件 ...

  2. 第n次搭建 SSM 框架

    什么说第 N 次搭建SSM框架呢? 刚学习java的时候,搭建 SSM 框架想做一个个人项目之类的,后来没搭起来,也就拖延了,进入公司之后,接触的第一个项目就是SSM的,模仿了一下,也能搭个简简单单的 ...

  3. 详解intellij idea搭建SSM框架(spring+maven+mybatis+mysql+junit)(下)

    在上一篇(详解intellij idea 搭建SSM框架(spring+maven+mybatis+mysql+junit)(上))博文中已经介绍了关于SSM框架的各种基础配置,(对于SSM配置不熟悉 ...

  4. 详解intellij idea搭建SSM框架(spring+maven+mybatis+mysql+junit)(上)

    SSM(Spring+SpringMVC+MyBatis)框架集由Spring.SpringMVC.MyBatis三个开源框架整合而成,常作为数据源较简单的web项目的框架. 其中spring是一个轻 ...

  5. IDEA搭建ssm框架测试衍生出的问题The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Develop\jdk7\jdk1.7.0_79\bin;

    最近玩起IDEA这开发工具,搭建ssm框架测试时,部署项目出现如下问题: 信息: The APR based Apache Tomcat Native library which allows opt ...

  6. 自动搭建ssm项目

    手把手教你搭建ssm项目 注意,必须修改:包名.数据库名称.账号.密码 注意:必须配置好第一次,“引入后”才能配置第二次 第一步:打开idea选择创建maven项目 import java.io.*; ...

  7. maven搭建ssm

    前言 本文旨在利用maven搭建ssm环境,而关于maven的具体内容,大家可以去阅读<Maven 实战>.其实园内这方面文章已有不少,那么为什么我还要重复造轮子呢?我只是想记录自己的实践 ...

  8. 如何搭建maven项目和搭建ssm框架

    1.基本概念 1.1.Spring Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框架,由Rod Johnson 在其著作Expert One-On-One ...

  9. 一步一步教你用IntelliJ IDEA 搭建SSM框架(1)

    1.基本概念 SSM框架指:Spring MVC + Spring + MyBatis Spring MVC是一种web层mvc框架,用于替代servlet,处理|响应请求,获取表单参数,表单校验等 ...

随机推荐

  1. 【Iperf】iperf测试wlan的性能

    1.概念: iperf命令是一个网络性能测试工具.iperf可以测试TCP和UDP带宽质量. iperf可以测量最大TCP带宽,具有多种参数和UDP特性.iperf可以报告带宽,延迟抖动和数据包丢失. ...

  2. Devexpress Xtrareport 创建主从报表

    效果 xtrareport 布局 From 代码 private DataSet Getdata() { DataSet ds = new DataSet(); //config配置字符串 strin ...

  3. Access 2010入门、语文

    Access2010入门 数据管理库是按照数据结构来组织,存储和管理数据的仓库. 最早出现的数据库是网状DBMS 1970年,EFCodd博士提出关系模型的概念,提出关系模型的理论基础. SQL语言功 ...

  4. mysql关键字执行顺序

    from on join where group by having select distinct union order by 昨天去58面试,之前的java基础和数据结构算法之类的都还可以,最后 ...

  5. 微信小程序入门开发文档

    第一步:下载微信小程序开发者工具并安装,下载路径: https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html 进到下载界面后,根 ...

  6. maven课程 项目管理利器-maven 3-7 maven依赖范围 2星

    本节主要讲了maven的依赖范围: 在pom.xml   dependency标签的scope中.eclipse中有编译的路径,maven中有编译,运行,测试的路径. 1 scope为test,为测试 ...

  7. Flask-Script-Migrate

    Flask-Script 从字面意思上来看就是 Flask 的脚本 是的,熟悉Django的同学是否还记得Django的启动命令呢? python manager.py runserver 大概是这样 ...

  8. (C#) Handling and Raising Events

    Handling and Raising Events .NET Framework 4.5   Other Versions     6 out of 20 rated this helpful - ...

  9. cocos2d-x游戏之2048

    学习游戏编程是一件非常有趣的事情,在cocos2dx官网找了几个简单的游戏试试手,感觉也不是那么难,首先来看看2048这款游戏吧,很火的原因之一是因为它简单而易操作.网上这位Legendof1991大 ...

  10. (转)两张Firefox OS 系统截图

    锁屏图 锁屏就是一个向上的小火箭. 桌面 桌面又是另一种风格. 注意 以上为Android系统下运行b2g. 原文地址,TZone