简体   繁体   English

部署 Springboot Web 服务 Heroku。 配置 Dyno 形成时出现错误 [无法访问 jarfile server.port]

[英]Deploy Springboot Webserivce Heroku. ERROR [Unable to access jarfile server.port] when config Dyno formation

I am Trying to deploy a Spring Boot Web service.我正在尝试部署 Spring 引导 Web 服务。 Firstly I met No Web Process Running and i resolved It By adding Procfile and It's worked nomarlly until i deployed newest code.首先,我遇到没有 Web 进程正在运行,我通过添加 Procfile 解决了它,它正常工作,直到我部署了最新的代码。 I didn't change any thing in pom.xml file and Profile, It's still work in local.我没有更改 pom.xml 文件和配置文件中的任何内容,它仍然在本地工作。 This is my heroku Log error:这是我的 heroku 日志错误: 这是heroku日志错误 Profile: web: java -jar $JAVA_OPTS -D server.port=$PORT target/SWDProject-0.2.jar pom.xml: Profile: web: java -jar $JAVA_OPTS -D server.port=$PORT target/SWDProject-0.2.jar pom.xml:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.1.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>swd</groupId>
<artifactId>SWDProject</artifactId>
<version>0.2</version>
<name>SWDProject</name>
<description>Demo project for Spring Boot</description>

<properties>
    <java.version>1.8</java.version>
</properties>

Hope you guys can help.希望大家能帮忙。 Thanks for reading.谢谢阅读。

Removing the blank space before system property server.port should fix this issue.删除系统属性 server.port 之前的空格应该可以解决此问题。

So instead -D server.port=$PORT use -Dserver.port=$PORT .所以改为-D server.port=$PORT使用-Dserver.port=$PORT

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

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