Java mybatis+;spring boot 1.4.2:MybatisAutoConfiguration$$EnhancerBySpringCGLIB构造函数引发了异常NoniqueBeandDefinitionException

Java mybatis+;spring boot 1.4.2:MybatisAutoConfiguration$$EnhancerBySpringCGLIB构造函数引发了异常NoniqueBeandDefinitionException,java,spring,spring-boot,spring-mybatis,Java,Spring,Spring Boot,Spring Mybatis,我在尝试将spring boot 1.4.2应用程序部署到tomcat 7时遇到此错误: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'applicationServiceImpl': Unsatisfied dependency expressed through field 'applicationDao'; nested exception i

我在尝试将spring boot 1.4.2应用程序部署到tomcat 7时遇到此错误:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'applicationServiceImpl': Unsatisfied dependency expressed through field 'applicationDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'applicationDao' defined in file [E:\sources\apache-tomcat-7.0.86\webapps\OnlineChannelBackend-0.0.1-SNAPSHOT\WEB-INF\classes\com\pack\dao\ApplicationDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$f214bdd7]: Constructor threw exception; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'java.lang.Object' available: expected single matching bean but found 4: &applicationDao,systemEnvironment,contextParameters,contextAttributes
我的相关构建梯度:

sourceCompatibility = 1.6 //java6
targetCompatibility = 1.6

dependencies {
    compile('org.springframework.boot:spring-boot-legacy:1.1.0.RELEASE')
    compile('org.springframework.boot:spring-boot-starter-web:1.4.2.RELEASE')
    compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2')
    compile('com.oracle:ojdbc6:11.1.0.7.0') //java6
    providedRuntime('org.apache.tomcat:tomcat-juli:7.0.59') // java6
    compile group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: '7.0.59'

在com.pack.dao中,我有3个用
@mapper
注释的映射器接口,在参考资料中的相应文件夹中有相应的xml文件。。。该应用程序在spring boot 2上运行良好,但一旦我开始将其更改为spring boot 1.4.2,我就无法使其工作

因为它在以前的spring版本中工作,我相信您已经有了配置文件,因此您可能需要为我的batis排除spring auto configurer

@SpringBootApplication
@EnableAutoConfiguration(exclude = {MybatisAutoConfiguration.class})

你有多个数据源吗?没有…目前我正在使用jdbc连接。。。没有数据源好的,如果你尝试下面我的答案我现在正在尝试好的改变了我的答案,以前有错误的类名谢谢一百万。。。它救了我一天。。。事实上,我以编程方式定义了一个数据源,它工作正常