0
我在外部Tomcat中使用spring-boot部署了一個Web應用程序,並且在下面得到了啓動錯誤。Tomcat8啓動錯誤(彈簧引導):SEVERE:部署Web應用程序目錄時出錯(-Dnop)
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次更改。
變化1>在Application.java
@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);
}
}
變化2>中的pom.xml
<packaging>war</packaging>
變化3>中的pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
我與不同測試彈簧靴的版本。
spring-boot 1.2.5 : no issue.
spring-boot 1.3.8 : has the issue.
spring-boot 1.4 : has the issue.
它可能是一個彈簧引導的錯誤,或者我錯過了一些配置在外部Tomcat服務器上部署spring-boot? 這將不勝感激,如果你能幫我解決這個問題。
開始我對你的關注和評論非常感激。輝煌!!非常感謝你! – claire
@claire我的榮幸!幾周前我遇到了同樣的問題,所以我想我也可以在這個過程中修復它:) –