在bean上销毁名为' org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory'的方法抛出一个例外

时间:2017-10-16 23:25:09

标签: java spring maven spring-boot spring-data-jpa

我一直试图解决这个" destory方法异常"有在线提示但没有成功。以下是错误消息:

  

2017-10-16 15:58:13.234 ERROR 12276 --- [main] o.s.b.f.s.DefaultListableBeanFactory:在bean上销毁名称' org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory'抛出异常

这是我的POM.xml依赖项:

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-aws</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-aws-jdbc</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.16.6</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
</dependencies>

从网上看,问题出在spring-boot-starter-data-jpa依赖项上。我尝试了旧版本的依赖性,并清理了mvn,但它们都没有用。

更新

从spring initializr重新生成pom之后,我仍然遇到了同样的错误。这是我的pom.xml依赖项:

    <dependencies>
<!--need this aws dependency for some packages-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-aws</artifactId>
        </dependency>
<!--need this aws dependency for some packages-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-aws-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.16.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
    </dependencies>

有什么建议吗?

2 个答案:

答案 0 :(得分:1)

这里有很多重复的罐子..

我会去here生成一个具有所需依赖项的spring项目。

答案 1 :(得分:0)

我也有相同的问题,例外

:Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized

并且错误出在我的spring profile的声明语法中

@Profile({"production, dev"})

正确的方法:

@Profile({"production","dev"}) 
相关问题