今天遇到的一个小异常,报错信息如下:

2013-11-13 10:00:32 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [file:/C:/apache-tomcat-6.0.16/webapps/acode/WEB-INF/classes/springconf/application-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [ibatisconf/SqlMapConfig.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.ca.agent.dao.mapper.IllegalPunishncaInforMapper.selectIllegalPunishncaInforByOfficeCode
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [ibatisconf/SqlMapConfig.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.ca.agent.dao.mapper.IllegalPunishncaInforMapper.selectIllegalPunishncaInforByOfficeCode
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:378)
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:293)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 27 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.ca.agent.dao.mapper.IllegalPunishncaInforMapper.selectIllegalPunishncaInforByOfficeCode
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:106)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:89)
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:372)
... 30 more
Caused by: java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.ca.agent.dao.mapper.IllegalPunishncaInforMapper.selectIllegalPunishncaInforByOfficeCode
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:113)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:88)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:311)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:104)
... 32 more
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.ca.agent.dao.mapper.IllegalPunishncaInforMapper.selectIllegalPunishncaInforByOfficeCode
at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:645)
at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:617)
at org.apache.ibatis.session.Configuration.addMappedStatement(Configuration.java:450)
at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:295)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:110)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:128)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:121)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:111)
... 35 more

这个异常,比较容易处理,异常的提示信息明确的指出在对应的与数据库交互的文件中已经包含了对应的语句“selectIllegalPunishncaInforByOfficeCode”,就是对应的语句中ID有重复的情况,找到对应的语句将对应的ID修改一下即可。

org.springframework.core.NestedIOException的更多相关文章

  1. Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file

    springframework.version  3.2.6.RELEASE jdk 1.8

  2. org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably du

    如果出现类似下面的错误,原因就是JDK版本太高了,我换成1.7就没事了 Caused by: org.springframework.core.NestedIOException: ASM Class ...

  3. Spring MVC 单元测试异常 Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file

    Sping 3.2.8.RELEASE + sping mvc + JDK 1.8运行异常. java.lang.IllegalStateException: Failed to load Appli ...

  4. org.springframework.core.io包内的源码分析

    前些日子看<深入理解javaweb开发>时,看到第一章java的io流,发觉自己对io流真的不是很熟悉.然后看了下JDK1.7中io包的一点点代码,又看了org.springframewo ...

  5. 无法访问org.springframework.core.NestedRuntimeException 找不到org.springframework.core.NestedRuntimeException的类文件

    在学习springAOP时,出现如下异常: 无法访问org.springframework.core.NestedRuntimeException 找不到org.springframework.cor ...

  6. 【Junit 报错】No appenders could be found for logger (org.springframework.core.env.StandardEnvironment).

    Junit报错 log4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvi ...

  7. class org.springframework.core.type.classreading.ClassMetadataReadingVisitor has interface org.springframework.asm.ClassVisitor as super class

    今天在工作中遇到了下面的问题: java.lang.IllegalStateException: Failed to load ApplicationContext at org.springfram ...

  8. org/springframework/core/MethodClassKey

    解决下面报错的办法: 把pom.xml中下面两个dependency的version去掉. <dependency> <groupId>org.springframework& ...

  9. org.springframework.core.Ordered接口

    关于Ordered接口,用过的人可能知道,这里我谈下自己的理解.也希望各位大神能给予指点. 源码如下: /**  * Interface that can be implemented by obje ...

随机推荐

  1. 【wp之二 页面布局】

    1. panoramic全景视图 新建工程选择:Windows Phone Panorama Application 相当于用放大镜看报纸的感觉.用一张图片作为背景. 2.pivot透视视图

  2. java 对象传递 是 值传递 还是 引用传递?

    这个问题说实话我感觉没有太大的意义. 按第一印象和c++的一些思想去理解的话对象传递是引用传递,因为传递过去的对象的值能被改变. 但是又有很多人,不知道从哪里扣出来一句,java中只有值传递,没有引用 ...

  3. PLSQL_性能优化系列08_Oracle Insert / Direct Insert性能优化

    2014-09-25 Created By BaoXinjian

  4. Apache2 Axis2/C 搭建 hello world

    参考 http://www.cnblogs.com/fjchenqian/archive/2012/08/05/2623601.html http://www.cnblogs.com/ezhong/a ...

  5. UCOS-消息队列(学习笔记)

    消息队列的核心是一个消息的指针数组,UCOS系统初始化时根据OS_CONFI.h中的最大队列个数定义这么多个消息队列(队列的结构)并将他们串联成空的链表,创建消息队列时从空链表中抽出一个并用指针数组的 ...

  6. git 空提交和重置提交者(转载)

    From:http://www.xiukun.me/git%E4%BD%BF%E7%94%A8-allow-empty-%E8%BF%9B%E8%A1%8C%E7%A9%BA%E7%99%BD%E6% ...

  7. DTD限制XML文件

    需要通过使用Microsoft Visual Studio 2010.XMLSpy或者eclipse软件来检查校验 文件中有中文,需要存为utf-8编码 book.dtd <!ELEMENT 书 ...

  8. java反射1

    一.Class部分 加载类的几种方式 // 1. Class clazz = Class.forName("com.wzh.test.reflect.Person"); // 2. ...

  9. ios统计代码行数

    要统计ios开发代码,包括头文件的,终端命令进入项目目录下,命令如下 列出每个文件的行数: find . -name "*.m" -or -name "*.h" ...

  10. sqlserver函数大全

    一旦成功地从表中检索出数据,就需要进一步操纵这些数据,以获得有用或有意义的结果.这些要求包括:执行计算与数学运算.转换数据.解析数值.组合值和聚合一个范围内的值等. 下表给出了T-SQL函数的类别和描 ...