简体   繁体   English

当我运行 Spring 引导应用程序时,我收到以下错误。 我正在使用 spring 启动版本 2.3.1

[英]When I am running my Spring Boot application, I am getting the below error. I am using spring boot version 2.3.1

Spring Boot application error, When I am running my Spring Boot application. Spring 启动应用程序错误,当我运行我的 Spring 启动应用程序时。 I am getting the below error.我收到以下错误。 I am using spring boot version 2.3.1我正在使用 spring 启动版本 2.3.1

java.lang.IllegalArgumentException: Could not find class [org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration]
    at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:334) ~[spring-core-5.2.7.RELEASE.jar:5.2.7.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotation.adapt(TypeMappedAnnotation.java:446) ~[spring-core-5.2.7.RELEASE.jar:5.2.7.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotation.getValue(TypeMappedAnnotation.java:369) ~[spring-core-5.2.7.RELEASE.jar:5.2.7.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotation.asMap(TypeMappedAnnotation.java:284) 

my pom.xml file is given below I have tried to add dependencies but it's not working下面给出了我的 pom.xml 文件我尝试添加依赖项,但它不起作用

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.1.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.mani.restws</groupId>
    <artifactId>restws</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>restws</name>
    <description>Patient REST Services</description>
<properties>
        <java.version>1.8</java.version>
    </properties>
<dependencies>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
            <version>3.1.11</version>
        </dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-autoconfigure</artifactId>
 <!--    <version>2.3.1.RELEASE</version> -->
</dependency>
            <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </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>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>       
            </plugin>
        </plugins>
    </build>  
</project>

In my case problem in this dependency:就我而言,这种依赖关系的问题:

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
    <version>3.1.11</version>
</dependency>

You can change version for this and add hibernate-validator您可以为此更改版本并添加 hibernate-validator

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
    <version>3.3.6</version>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>6.1.5.Final</version>
</dependency>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我运行我的 Spring 引导应用程序时,我收到以下错误。 我正在使用 spring 启动版本 2.4.5 - While I am running my Spring Boot application, I am getting the below error. I am using spring boot version 2.4.5 我正在升级到 spring 启动 2.5.12,并在下面收到此错误 - I am upgrading to spring boot 2.5.12, and am getting this error below 我在使用 spring boot 版本 2.2.0 的 spring 批处理中遇到错误 - I am getting error in spring batch with spring boot version 2.2.0 当我使用Spring Boot运行项目时。 一切正常。 但是当我在tomcat中部署它时。 我收到以下书面异常 - When I am running project using spring boot. It is working fine. But When I am deploying it in tomcat. I am getting Below Written Exception 第一次在 eclipse 中运行 spring 启动应用程序时,我收到错误警告。 我正在使用 JDK 14 - I am getting error warning while running first time spring boot application in eclipse. I am using JDK 14 我正在运行基于 java spring 引导框架的应用程序。 但得到这个错误。 你能帮我解决这个错误吗? - I am running my application which is based java spring boot framework. but getting this error. Can you help me to resolve this error? 为什么我的 Spring Boot 应用程序出现异常? - Why am I getting exception in my Spring Boot Application? 当我尝试使用 Spring Boot 将产品添加到购物车时出现错误 - I am getting an error while i am trying to add a product to the cart using Spring boot 为什么使用 Spring 引导应用程序在 postman 中没有收到错误消息 - Why I am not getting error message in postman using Spring Boot Application 我在Spring Boot中遇到API调用404错误 - I am getting a 404 Error on API Call in Spring Boot
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM