One trick: nested exception is org.springframework.boot.web.server.WebServerException Unable to s

一招搞定:Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat

The following error occurred during the process of building the springcloud project and starting eureka, what should I do?

Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat

I found several versions of solutions on Baidu, and this solution solved my problem:

The reason for the error:

​ During the loading process of the project, the jaxb-api package is missing.

solution:

​ The jaxb package is stored in jdk, but starting from java9, this package is no longer loaded by default during the loading process of the project, so here we need to manually add dependencies in the pom.xml file of the project.

​ If it is java8 and below, you may have to find other solutions.

The code is as follows, take it yourself

<!-- 从java9开始,项目就不会默认加载jdk中的jaxb包,所以此处手动引入jaxb-api包 -->
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-core</artifactId>
            <version>2.2.11</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.2.11</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.2.10-b140310.1920</version>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
        </dependency>

ok, the problem is solved, if you can't solve it, just continue to Baidu, and you will definitely find a solution!

Guess you like

Origin blog.csdn.net/xiri_/article/details/111085062