Tomcat8 启动错误(spring-boot):严重:部署 Web 应用程序目录时出错(-Dnop)

Tomcat8 Startup Error (spring-boot) : SEVERE: Error deploying web application directory (-Dnop)

我在外部使用 spring-boot 部署了一个 Web 应用程序 Tomcat 并收到以下启动错误。

org.apache.catalina.core.ApplicationContext log
INFO: 2 Spring WebApplicationInitializers detected on classpath
Logging system failed to initialize using configuration from '-Dnop'
java.io.FileNotFoundException: /.../.../../home/work/-Dnop (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at java.net.URL.openStream(URL.java:1045)
    at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:303)

为了在外部 Tomcat 服务器中部署我的应用程序,我进行了 3 处更改。

在 Application.java

中更改 1>
@SpringBootApplication
public class Application extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }

    public static void main(String[] args) throws Exception {
        SpringApplication.run(Application.class, args);
    }

}

在 pom.xml

中更改 2>
<packaging>war</packaging>

在 pom.xml

中更改 3>
<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
</dependency>

我测试了不同版本的 spring-boot。

spring-boot 1.2.5 : no issue.
spring-boot 1.3.8 : has the issue.
spring-boot 1.4 : has the issue.

这可能是 spring-boot 的错误,还是我错过了一些在外部 Tomcat 服务器中部署 spring-boot 的配置? 如果您能帮我解决这个问题,我们将不胜感激。

这是一个错误。发生的原因之一是 \conf\logging.properties 中没有文件 Tomcat.

无论如何,问题已从 Spring Boot 1.4.3 cf https://github.com/spring-projects/spring-boot/pull/7639

开始得到解决