微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何解决“更正应用程序的类路径,使其包含单个兼容版本”

如何解决如何解决“更正应用程序的类路径,使其包含单个兼容版本”

我在 Java spring boot 中遇到了问题,我认为它的版本问题,但我无法完全理解,它工作正常,但在多次运行后显示此消息。 这是错误,它一直显示

   Description:
    
    An attempt was made to call a method that does not exist. The attempt was made from the following location:
    
        java.lang.invoke.MethodHandleNatives.resolve(Native Method)
    
    The following method did not exist:
    
        org.springframework.scheduling.concurrent.ExecutorConfigurationSupport.setAwaitTerminationMillis(J)V
    
    The method's class,org.springframework.scheduling.concurrent.ExecutorConfigurationSupport,is available from the following locations:
    
           jar:file:/C:/Users/R/Downloads/demo%20(2)%20-%20copy/demo/lib/spring-context-5.2.3.RELEASE.jar!/org/springframework/scheduling/concurrent/ExecutorConfigurationSupport.class
jar:file:/C:/Users/R/.m2/repository/org/springframework/spring-context/5.2.15.RELEASE/spring-context-5.2.15.RELEASE.jar!/org/springframework/scheduling/concurrent/ExecutorConfigurationSupport.class
    
    The class hierarchy was loaded from the following locations:
    
        org.springframework.scheduling.concurrent.ExecutorConfigurationSupport: 
file:/C:/**/lib/spring-core-5.2.3.RELEASE.jar
file:/C:/**/lib/spring-core-5.2.3.RELEASE.jar 
file:/C:/**/lib/spring-core-5.2.3.RELEASE.jar
    
    
    Action:
    
    Correct the classpath of your application so that it contains a single,compatible version of org.springframework.scheduling.concurrent.ExecutorConfigurationSupport

.................................

这是我在 pom.xml 中的依赖项:

<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.12.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
    <java.version>8</java.version>
</properties>
<dependencies>
    <!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa -->
    <dependency>
        <groupId> org.springframework.data </groupId>
        <artifactId> spring-data-jpa </artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>com.microsoft.sqlserver</groupId>
        <artifactId>mssql-jdbc</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

我的依赖有什么问题吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。