Home > Back-end >  [question] springboot start related, mybatis mapper configuration problems
[question] springboot start related, mybatis mapper configuration problems

Time:10-09

In application. The properties, configuration: mybatis mapperLocations=classpath: mapper/*. XML, found to boot error, can't create the action of bean, so behind the conclusion:
When the *. Some XML, XML into a concrete such as the user. The XML, you can run, user database can also smooth operation;
Don't change the configuration file, the mapper XML file folder, delete to only one, also can run, also can't normal operation;
So feel into a singleton, can't use it under my mapper other, have know the situation? For the first time to use springboot, a great god, please,

CodePudding user response:

Some people? O god ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

CodePudding user response:

Run without using an error is reported to the injection failure, first controller into failure, then the service, to the dao, all the way down is failure
Org. Springframework. Beans. Factory. BeanCreationException: Error creating bean with the name 'basedictController: Injection of resource dependencies failed; Nested exception is org. Springframework. Beans. Factory. BeanCreationException: Error creating bean with the name 'basedictService: Injection of resource dependencies failed; Nested exception is org. Springframework. Beans. Factory. UnsatisfiedDependencyException: Error creating bean with the name 'basedictMapper defined in the file [D: \ idea - project \ secondboot \ target \ classes \ com \ zheng \ secondboot \ mapper \ basedictMapper class] : Unsatisfied dependency expressed through the bean property' sqlSessionFactory '; Nested exception is org. Springframework. Beans. Factory. BeanCreationException: Error creating bean with the name 'sqlSessionFactory defined in the class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration class] : bean instantiation via the factory method failed; Nested exception is org. Springframework. Beans. BeanInstantiationException: Failed to instantiate [org. Apache. Ibatis. Session. SqlSessionFactory] : the Factory method 'SqlSessionFactory threw the exception. Nested exception is org. Springframework. Core. NestedIOException: Failed to parse mapping resource: 'file [D: \ idea - project \ secondboot \ target \ classes \ mybatis \ BasedictMapper XML]'. Nested exception is org. Apache. Ibatis. Builder. BuilderException: Error parsing XML Mapper. The location of The XML is' file [D: \ idea - project \ secondboot \ target \ classes \ mybatis \ BasedictMapper XML] '. The Cause: Java. Lang. IllegalArgumentException: Result Maps collection already contains The value for The com. Zheng. Secondboot. Mapper. BasedictMapper. BaseResultMap
At org.springframework.context.annotation.Com monAnnotationBeanPostProcessor. PostProcessPropertyValues (CommonAnnotationBeanPostProcessor. Java: 321) ~ [spring - the context - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. PopulateBean (AbstractAutowireCapableBeanFactory. Java: 1348) ~ [spring - beans - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. DoCreateBean (AbstractAutowireCapableBeanFactory. Java: 578) ~ [spring - beans - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. CreateBean (AbstractAutowireCapableBeanFactory. Java: 501) ~ [spring - beans - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Beans. Factory. Support. AbstractBeanFactory. Lambda $doGetBean $0 (AbstractBeanFactory. Java: 317) ~ [spring - beans - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Beans. Factory. Support. DefaultSingletonBeanRegistry. GetSingleton (DefaultSingletonBeanRegistry. Java: 228) ~ [spring - beans - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Beans. Factory. Support. AbstractBeanFactory. DoGetBean (AbstractBeanFactory. Java: 315) ~ [spring - beans - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Beans. Factory. Support. AbstractBeanFactory. GetBean (AbstractBeanFactory. Java: 199) ~ [spring - beans - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Beans. Factory. Support. DefaultListableBeanFactory. PreInstantiateSingletons (DefaultListableBeanFactory. Java: 760) ~ [spring - beans - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Context. Support. AbstractApplicationContext. FinishBeanFactoryInitialization (AbstractApplicationContext. Java: 869) ~ [spring - the context - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Context. Support. AbstractApplicationContext. Refresh (AbstractApplicationContext. Java: 550) ~ [spring - the context - 5.0.6. The jar: 5.0.6. RELEASE]
The at org. Springframework. Boot. Web. Servlet. Context. ServletWebServerApplicationContext. Refresh (ServletWebServerApplicationContext. Java: 140) ~ [spring - the boot - 2.0.2. The jar: 2.0.2. RELEASE]
The at org. Springframework. Boot. SpringApplication. Refresh (SpringApplication. Java: 759) [spring - the boot - 2.0.2. The jar: 2.0.2. RELEASE]
The at org. Springframework. Boot. SpringApplication. RefreshContext (SpringApplication. Java: 395) [spring - the boot - 2.0.2. The jar: 2.0.2. RELEASE]
The at org. Springframework. Boot. SpringApplication. Run (SpringApplication. Java: 327) [spring - the boot - 2.0.2. The jar: 2.0.2. RELEASE]
The at org. Springframework. Boot. SpringApplication. Run (SpringApplication. Java: 1255) [spring - the boot - 2.0.2. The jar: 2.0.2. RELEASE]
The at org. Springframework. Boot. SpringApplication. Run (SpringApplication. Java: 1243) [spring - the boot - 2.0.2. The jar: 2.0.2. RELEASE]
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related