idea启动报错!求指导!!!

西萌子 2019-06-24 05:27:28
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'manageController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'courseMapper' defined in file [C:\Users\lenovo-pc\Desktop\demo\target\classes\com\example\mapper\CourseMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\Users\lenovo-pc\Desktop\demo\target\classes\mybatis\mapping\ClassMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [C:\Users\lenovo-pc\Desktop\demo\target\classes\mybatis\mapping\ClassMapper.xml]'. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.example.mapper.ClassMapper.BaseResultMap
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:324) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at com.example.DemoApplication.main(DemoApplication.java:15) [classes/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'courseMapper' defined in file [C:\Users\lenovo-pc\Desktop\demo\target\classes\com\example\mapper\CourseMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\Users\lenovo-pc\Desktop\demo\target\classes\mybatis\mapping\ClassMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [C:\Users\lenovo-pc\Desktop\demo\target\classes\mybatis\mapping\ClassMapper.xml]'. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.example.mapper.ClassMapper.BaseResultMap
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1515) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1395) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeanByName(AbstractAutowireCapableBeanFactory.java:452) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:526) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:496) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:636) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:180) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:321) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
... 17 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\Users\lenovo-pc\Desktop\demo\target\classes\mybatis\mapping\ClassMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [C:\Users\lenovo-pc\Desktop\demo\target\classes\mybatis\mapping\ClassMapper.xml]'. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.example.mapper.ClassMapper.BaseResultMap
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
...全文
196 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
代码间的舞者 2019-06-25
  • 打赏
  • 举报
回复
启动项目时,加载这个文件报错 \mybatis\mapping\ClassMapper.xml
参考:https://www.cnblogs.com/qiyifeng/p/9746355.html
对梦想的牵挂 2019-06-25
  • 打赏
  • 举报
回复
应该是你的ClassMapper.xml文件中写了多个 id=BaseResultMap 的结果集。Mybatis的自动生成会叠加的
「已注销」 2019-06-24
  • 打赏
  • 举报
回复
Error parsing Mapper XML. The XML location is 'file [C:\Users\lenovo-pc\Desktop\demo\target\classes\mybatis\mapping\ClassMapper.xml]'. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.example.mapper.ClassMapper.BaseResultMap
内容概要:本文详细介绍了 IntelliJ IDEA 的下载、安装及首次配置的全过程。文章首先阐述了 IDEA 的重要性和功能特点,接着根据用户需选择社区版或旗舰版,并确认系统兼容性。随后,逐步讲解了从官网下载、运行安装包到完成安装的具体步骤。首次配置部分涵盖工作目录设置、项目创建或打开、SDK配置、界面个性化设置、插件安装与配置以及JDK配置等关键环节。最后,提供了下载失败、安装报错和首次启动失败等常见问题的解决方案。; 适合人群:初次接触或打算使用 IntelliJ IDEA 进行 Java 开发的程序员,尤其是编程新手和有一定开发经验但未使用过 IDEA 的开发者。; 使用场景及目标:①帮助用户从零开始掌握 IntelliJ IDEA 的下载、安装和基本配置;②确保用户能够顺利完成 IDEA 的安装并根据个人需进行个性化设置;③解决用户在下载、安装和首次配置过程中可能遇到的常见问题,确保顺利开启 Java 开发之旅。; 其他说明:本文不仅提供了详细的步骤指导,还解释了每个步骤背后的原因和注意事项,帮助用户更好地理解和掌握 IDEA 的使用方法。通过本文的学习,用户不仅能顺利完成 IDEA 的安装配置,还能为后续的 Java 开发打下坚实的基础。
内容概要:本文详细介绍了 IntelliJ IDEA 的下载安装全流程,旨在帮助用户轻松开启高效的 Java 开发之旅。首先解释了 IntelliJ IDEA 的两个主要版本:社区版适合初学者和小型项目,功能涵盖基本的 Java 开发需;专业版面向企业级开发,提供更强大的功能,如高级代码分析、多语言支持等。接着,文章逐步指导用户从访问官方网站、选择版本、下载安装包到具体操作系统(Windows、macOS 和 Linux)下的安装步骤。对于每个平台,都提供了详细的安装指引,包括配置安装选项、创建桌面快捷方式、设置环境变量等。首次使用时,用户可以配置主题、安装插件以及配置 Java 开发环境。最后,文章还列举了一些常见问题及其解决方案,如安装报错启动无响应和插件安装失败等,确保用户顺利使用 IntelliJ IDEA。 适用人群:适合所有 Java 开发者,特别是初学者和需要进行复杂项目开发的资深开发者。 使用场景及目标:①帮助初学者快速上手 Java 开发,掌握基础的开发工具使用;②协助资深开发者进行高效的企业级项目开发,充分利用 IntelliJ IDEA 的高级功能;③解决安装和初始配置过程中可能出现的问题,确保开发环境稳定运行。 其他说明:本文不仅提供了详尽的安装指南,还强调了 IntelliJ IDEA 的强大功能和灵活性,鼓励用户根据自身需选择合适的版本,并通过配置和插件扩展来优化开发体验。此外,针对不同操作系统给出了具体的安装步骤,确保用户能够在各自的平台上顺利完成安装。

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧