org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [/Users/fanwei/IdeaProjects/Springmybatis/target/classes/occ/myframework/dao/UserInfoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:occ/myframework/mapping/*.xml]: class path resource [occ/myframework/mapping/] cannot be resolved to URL because it does not exist

segmentfault.com | 3 months ago
  1. 0

    Mybatis+Spring整合问题,NoSuchBeanDefinitionException - SegmentFault

    segmentfault.com | 2 months ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [/Users/fanwei/IdeaProjects/Springmybatis/target/classes/occ/myframework/dao/UserInfoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:occ/myframework/mapping/*.xml]: class path resource [occ/myframework/mapping/] cannot be resolved to URL because it does not exist
  2. 0

    Mybatis+Spring整合问题,NoSuchBeanDefinitionException - wallacefw1987的回答 - SegmentFault

    segmentfault.com | 4 months ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [/Users/fanwei/IdeaProjects/Springmybatis/target/classes/occ/myframework/dao/UserInfoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:occ/myframework/mapping/*.xml]: class path resource [occ/myframework/mapping/] cannot be resolved to URL because it does not exist
  3. 0

    Mybatis+Spring整合问题,NoSuchBeanDefinitionException - codeRose的回答 - SegmentFault

    segmentfault.com | 3 months ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [/Users/fanwei/IdeaProjects/Springmybatis/target/classes/occ/myframework/dao/UserInfoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:occ/myframework/mapping/*.xml]: class path resource [occ/myframework/mapping/] cannot be resolved to URL because it does not exist
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    技術検証2日目 | 男はロマン

    otokoroman.com | 7 months ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/session/data/redis/config/annotation/web/http/RedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
  6. 0

    Hessian Webservice with REST, Java Spring

    Stack Overflow | 4 years ago | Cid Immacula
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'photoService' bean method public java.lang.Object mppiwebservices.photoservices.impl.photo.PhotoServicesImpl.savePhoto(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.String,mppiwebservices.photoservices.pojo.Photo,org.springframework.validation.BindingResult,org.springframework.web.bind.support.SessionStatus) to {[/{user}/{folder_name}/savephoto/],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'photoServicesImpl' bean method public java.lang.Object mppiwebservices.photoservices.impl.photo.PhotoServicesImpl.savePhoto(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.String,mppiwebservices.photoservices.pojo.Photo,org.springframework.validation.BindingResult,org.springframework.web.bind.support.SessionStatus) mapped.

  1. rlovtangen 1 times, last 1 week ago
  2. tvrmsmith 6 times, last 2 weeks ago
  3. kjhdofjosvs 1 times, last 1 month ago
  4. Andreas Häber 2 times, last 1 month ago
  5. Luka 14 times, last 2 months ago
21 more registered users
74 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.beans.factory.NoSuchBeanDefinitionException

    No qualifying bean of type [occ.myframework.dao.UserInfoMapper] 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)}

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException()
  2. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1308)
    2. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1054)
    3. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
    4. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
    5. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
    6. org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
    7. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
    8. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
    9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
    10. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
    11. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    12. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    13. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    14. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    15. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    16. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
    16 frames
  3. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    2 frames
  4. Spring TestContext
    DefaultCacheAwareContextLoaderDelegate.loadContext
    1. org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)
    2. org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
    3. org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109)
    4. org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261)
    5. org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
    6. org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
    6 frames