Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何解决Spring引导程序文件heroku错误_Java_Spring Boot_Github_Heroku_Procfile - Fatal编程技术网

Java 如何解决Spring引导程序文件heroku错误

Java 如何解决Spring引导程序文件heroku错误,java,spring-boot,github,heroku,procfile,Java,Spring Boot,Github,Heroku,Procfile,我是heroku的新手,尝试使用github在heroku上部署我的第一个spring boot项目,但我遇到了错误: at=error code=H14 desc=“没有正在运行的web进程”方法=GET 我做了一些小的研发,并且知道我必须将Procfile添加到github中。因此,在添加ProcFile之后,仍然会出现以下错误: 错误:无法访问JAR文件 target/reactfull-webservice-0.0.1-SNAPSHOT.jar 请任何人都可以建议我应该改变什么 我犯了一

我是heroku的新手,尝试使用github在heroku上部署我的第一个spring boot项目,但我遇到了错误:

at=error code=H14 desc=“没有正在运行的web进程”方法=GET

我做了一些小的研发,并且知道我必须将Procfile添加到github中。因此,在添加ProcFile之后,仍然会出现以下错误:

错误:无法访问JAR文件 target/reactfull-webservice-0.0.1-SNAPSHOT.jar

请任何人都可以建议我应该改变什么

我犯了一个错误

 Starting process with command `java -Dserver.port=42877 -jar target/reactfull-webservice-0.0.1-SNAPSHOT.jar`
2021-04-07T09:30:17.000000+00:00 app[api]: Build succeeded
2021-04-07T09:30:17.677364+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2021-04-07T09:30:17.678838+00:00 app[web.1]: Error: Unable to access jarfile target/reactfull-webservice-0.0.1-SNAPSHOT.jar
2021-04-07T09:30:17.758735+00:00 heroku[web.1]: Process exited with status 1
2021-04-07T09:30:17.824379+00:00 heroku[web.1]: State changed from starting to crashed
2021-04-07T09:30:25.109822+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=springappwebproject.herokuapp.com request_id=fbabdc3f-eb42-4f06-9953-00c049907228 fwd="49.36.161.143" dyno= connect= service= status=503 bytes= protocol=https
2021-04-07T09:30:25.679219+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=springappwebproject.herokuapp.com request_id=451f2812-71cb-4f72-9e45-edbef79dc31f fwd="49.36.161.143" dyno= connect= service= status=503 bytes= protocol=https
程序文件

web: java -Dserver.port=$PORT -jar target/reactfullwebservice-0.0.1-SNAPSHOT.jar
.gitignore文件

HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.9.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.myfirstdemo</groupId>
    <artifactId>reactfull-webservice</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>reactfull-webservice</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

4.0.0
org.springframework.boot
spring启动程序父级
2.3.9.1发布
com.myfirstdemo
完全Web服务
0.0.1-快照
战争
完全Web服务
SpringBoot的演示项目
1.8
org.springframework.boot
spring引导启动器数据jpa
org.springframework.boot
SpringBootStarterWeb
org.springframework.boot
弹簧启动安全
org.springframework.boot
弹簧靴开发工具
运行时
真的
com.h2数据库
氢
运行时
org.springframework.boot
弹簧启动机tomcat
假如
org.springframework.boot
弹簧起动试验
测试
org.junit.vintage
朱尼特老式发动机
org.springframework.boot
springbootmaven插件

This
2021-04-07T09:30:17.678838+00:00应用程序[web.1]:错误:无法访问jarfile目标/reactfull-webservice-0.0.1-SNAPSHOT.jar
应该会告诉您出了什么问题。特别是因为您的打包是
war
而不是
jar
。我应该用warweb:java-Dserver.port=$port-jar-target/reactfullwebservice-0.0.1-SNAPSHOT.war替换jar吗?我已经更改了这一点,但仍然得到错误web:java-Dserver.port=$port-jar-target/reactfullwebservice-0.0.1-SNAPSHOT.warweb:java-Dserver.port=$port-war目标/reactfullwebservice-0.0.1-SNAPSHOT.war当我更改此选项时,其显示无法识别的选项:-war我应该更改什么您已将什么更改为什么以及什么错误?添加附加信息作为评论会使其完全不可读,而应编辑您的问题。你为什么把罐子变成了战争。。您只需要更改工件的名称。