繁体   English   中英

使用'webapp-runner'运行Spring Boot应用后,它在“ INFO:Starting ProtocolHandler [“ http-nio-8080”]”行中停止

[英]After running Spring boot app with 'webapp-runner' it's stoping on a line “INFO: Starting ProtocolHandler [”http-nio-8080“]”

我需要将applocation部署到heroku,它是由Spring Boot创建的,因此,我为它添加了一个webapp-runner.jar插件,现在无法在Heroku上运行,并且在本地计算机上,如果我使用webapp-runner.jar从cmd运行它,则会出现同样的问题。

现在我正在使用亚军9.0.24.0,因为我试图在版本8中运行它。

那是我在pom.xml中的插件

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <goals><goal>copy</goal></goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.github.jsimone</groupId>
                  <artifactId>webapp-runner</artifactId>
                  <version>9.0.24.0</version>
                  <destFileName>webapp-runner.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>

那是我的Procfile

web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/*.war

那是我从cmd的日志

авг 29, 2019 11:09:47 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
авг 29, 2019 11:09:48 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Tomcat]
авг 29, 2019 11:09:48 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet engine: [Apache Tomcat/9.0.24]
авг 29, 2019 11:09:49 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
авг 29, 2019 11:10:04 PM org.apache.catalina.core.ApplicationContext log
INFO: 1 Spring WebApplicationInitializers detected on classpath
авг 29, 2019 11:10:05 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
авг 29, 2019 11:10:05 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
WARNING: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [241] milliseconds.
авг 29, 2019 11:10:05 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]

它应该使用Procfile中的comand命令在本地计算机和Heroku中运行它。 我该如何解决该问题?

这篇文章过去对我有很大帮助,可能对您也很有用。

  • 将目录更改为Tomcat的安装位置,然后转到bin
  • 使用喜欢的nanovim编辑器打开catalina.sh文件。
  • 查找JAVA_OPTS并添加以下行:

-Djava.security.egd=file:/dev/./urandom

资料来源: https : //geekflare.com/tomcat-stuck-at-startup/

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM