java - 无法启动网络服务器;嵌套异常是 org.springframework.boot.web.server.WebServerException : Unable to start embedded Tomcat

标签 java spring-boot

at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:137) ~[spring-boot-2.0.0.M3.jar!/:2.0.0.M3]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-5.0.0.RC3.jar!/:5.0.0.RC3]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:122) ~[spring-boot-2.0.0.M3.jar!/:2.0.0.M3]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.0.0.M3.jar!/:2.0.0.M3]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386) [spring-boot-2.0.0.M3.jar!/:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.0.M3.jar!/:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [spring-boot-2.0.0.M3.jar!/:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [spring-boot-2.0.0.M3.jar!/:2.0.0.M3]
    at com.zophop.gps.ZophopFrontEndServer.main(ZophopFrontEndServer.java:16) [classes!/:0.0.3]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]

没有得到什么错误相同的代码在其他机器上运行

最佳答案

我使用 Java 11 并尝试使用 Spring Boot 应用程序运行 Eureka Discovery Server,然后在尝试运行此应用程序时出现此错误。

由于他们已从 Java 11 中删除 Jaxb 相关库,因此您已将它们添加为依赖项。

在 Maven POM 文件中添加以下内容:

    <!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.1</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl -->
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.3.2</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
    <dependency>
        <groupId>org.glassfish.jaxb</groupId>
        <artifactId>jaxb-runtime</artifactId>
        <version>2.3.2</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/javax.activation/activation -->
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1.1</version>
    </dependency>

关于java - 无法启动网络服务器;嵌套异常是 org.springframework.boot.web.server.WebServerException : Unable to start embedded Tomcat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50697513/

相关文章:

java - Hibernate - 使用一个 hibernate 映射查询多个表

java - Linux bash : java.net.ConnectException: 连接被拒绝

java - Akka EventBus for Java 示例

java - 如何在Reactor中使用PersistentQueue?

java - ElasticSearch 日期转换为 Java LocalDateTime 失败

spring - 无法配置数据源:未指定 'url'属性,并且无法配置任何嵌入式数据源。原因:Fa

spring-boot - 开类 : Spring boot : log4j settings -- configuration and finding the application log file

Spring 批处理不处理所有记录

java - hibernate + Spring 启动2 : Not checking the default schema

java - 如何强制属性等于常量值之一(在 Java 中)?