我的开发环境为:

ubuntu14.04LTS 64bit;

Spring Tool Suite  3.5.0.RELEASE

Maven 3.2.3

SSM整合中遇到的不能扫描注解的bug

最终解决方法:更换spring版本

bug详情:

这几天一直在被这个bug虐。所有的配置文件我和类文件都检查了N遍了都没问题。可就是开启包扫描后就报bug,关掉报扫描就没bug了。

部分错误:

17:02:37,149 ERROR TestContextManager:315 - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@7692d9cc] to prepare test instance [com.uujava.mbfy.test.TestMybatis@75f32542]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)

经过排查最终将3.2.0.RELEASE更换为3.2.4.RELEASE问题解决。

<!-- spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<!-- <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.0.RELEASE</version>
</dependency> -->

SSM整合中遇到的不能扫描注解的bug的更多相关文章

  1. SSM整合中每一框架需要做的基本操作简述

    1.dao层的工作 pojo和映射文件以及接口(使用逆向工程) SqlMapConfig.xml(Mybaits核心配置文件) ApplicationContext-dao.xml  整合后Sprin ...

  2. 总结在ssm整合中,Mybatis出现Mapped Statements collection already contains value for xxxxx的解决方案

    先贴一段报错信息: 前面的都不是很重要,看最后灰色标注的那段.... 严重: 异常将上下文初始化事件发送到类的侦听器实例.[org.springframework.web.context.Contex ...

  3. SSM框架中出现的几种注解的理解

    转自IT·达人原文 Spring5:@Autowired注解.@Resource注解和@Service注解,有删改. 传统的Spring做法是使用.xml文件来对bean进行注入或者是配置aop.事物 ...

  4. SSM整合中错误:Data truncation: Data too long for column 'gender' at row 1

    错误描述 ### SQL: insert into t_customer(name,gender,phone,address) values (?,?,?,?) ### Cause: com.mysq ...

  5. 学习黑马教学视频SSM整合中Security遇到的问题org.springframework.security.access.AccessDeniedException: Access is denied

    问题已解决. 总结: 报错:org.springframework.security.access.AccessDeniedException: Access is denied 当您遇到同样问题时, ...

  6. 在SSM框架中我设置拦截器filter不能通过注解获取到实现类

    我在用注解注入实现类的时候,出现了这样的错误:如以下截图: 这个地方报出的错误是说明我的一个接口类型的类没有获取到,后来我就想要是我的实现类没有获取到那么我就直接new一个实现类然后再进行调用就会出现 ...

  7. Maven + 最新SSM整合

    . 1. 开发环境搭建 参考博文:Eclipse4.6(Neon) + Tomcat8 + MAVEN3.3.9 + SVN项目完整环境搭建 2. Maven Web项目创建 2.1. 2.2. 2. ...

  8. ssm整合说明与模板-Spring Spring MVC Mybatis整合开发

    ssm整合说明 spring+spring mvc+mybatis 说明 源码下载 由于之前存在ssh框架,spring+struts+hibernate,其中spring负责aop与ioc,所以一般 ...

  9. SSM整合---实现全部用户查询

    SSM整合 准备 1.创建工程 2.导入必须jar包 链接: https://pan.baidu.com/s/1nvCDQJ3 密码: v5xs 3.工程结构 代码 SqlMapConfig < ...

随机推荐

  1. 寻找最大数--nyoj题目448

    寻找最大数 时间限制:1000 ms  |  内存限制:65535 KB 难度:2   描述 请在整数 n 中删除m个数字, 使得余下的数字按原次序组成的新数最大, 比如当n=920813467185 ...

  2. Eddy's research I

    Eddy's research I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others ...

  3. 你与优秀源码之间只差一个 Star

    fir.im Weekly - 你与优秀源码之间只差一个 Star   说起开源社区,Github 是一个不可缺少的存在.作为全球最大的同性交友网站,上面有太多优秀的开源代码库和编程大神,让无数开发者 ...

  4. 【C语言】单片机上的按键检测框架

    又好久没来写blog,最近在做项目发现之前写的stm32操作都忘了,还好做了个记录,回来看了下很多忘了的就又知道怎么做了. 下面是我之前写的一个按键检测的框架,适合比较多的按键操作,从信号接收.滤波. ...

  5. eclipse 软件的背景颜色、字体设置

    1.eclipse 背景色设置: Window->Preferences->General->Editors->Text Editors->Backgroud color ...

  6. javascript事件设计模式

    JavaScript事件设计模式 http://plkong.iteye.com/blog/213543 http://www.docin.com/p-696665922.html

  7. Linux进程间通信——使用流套接字

    前面说到的进程间的通信,所通信的进程都是在同一台计算机上的,而使用socket进行通信的进程可以是同一台计算机的进程,也是可以是通过网络连接起来的不同计算机上的进程.通常我们使用socket进行网络编 ...

  8. [置顶] Codeforces Round #190 (Div. 2)(完全)

    好久没有写博客了,一直找不到有意义的题可以写,这次也不算多么有意义,只是今天是比较空的一天,趁这个时候写一写. A. B. 有一点贪心,先把每个拿去3的倍数,余下0或1或2,然后三个一起拿. 对于以上 ...

  9. Android studio SweetAlert for Android

    找到个开源项目.github:https://github.com/pedant/sweet-alert-dialog 效果图:https://raw.githubusercontent.com/pe ...

  10. C# MySQL数据库的备份 还原 初始化

    // 执行创建数据库操作 this.GetExecute(G_Con, "create database if not exists NEWDB"); this.sqlAddres ...