springboot Caused by: java.lang.IllegalArgumentException: Property 'sessionFactory' is required

异常信息:springboot Caused by: java.lang.IllegalArgumentException: Property 'sessionFactory' is required

一般出现该类问题就是配置的问题,无论是xml配置。还是springboot的yml配置。仔细查找看看是否有错误的配置问题


2. 另外,在 springboot 中无法注入jdbcTemplate 的问题:


可能的异常:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] 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(DefaultListableBeanFactory.java:1373) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.beans.factory.annotation.AutowifredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]

    ... 24 common frames omitted

或者报 找不到jdbcTemplate 类异常;

修改pom.xml中的配置:

  
            org.springframework
            spring-jdbc
            4.2.5.RELEASE
        
改为
 
  

                    

你可能感兴趣的:(异常)