gpt4 book ai didi

java - 单击“打开应用程序”时,heroku 应用程序错误

转载 作者:行者123 更新时间:2023-12-01 17:58:10 25 4
gpt4 key购买 nike

我正在开发一个小型 Spring Boot 项目,并想将其部署到 Heroku 中(这是我第一次尝试这样做)。在阅读指南等后,我成功部署了它,并且构建应用程序没有问题。但是,当我单击打开应用程序时,我收到应用程序错误页面。这是我的日志:

2020-03-14T05:35:11.625149+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-14T05:35:11.610314+00:00 heroku[web.1]: Process exited with status 1
2020-03-14T05:35:11.318212+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-14T05:35:11.322803+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-03-14T05:35:11.543232+00:00 app[web.1]: Error: Could not find or load main class App
2020-03-14T05:35:39.112473+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=d33d96ca-a330-485b-8cd6-4821db5794bb fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T05:35:39.885329+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=teacherapppostgres.herokuapp.com request_id=a55e7b08-3939-42d0-9c55-fd2229cf3ea6 fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T05:40:06.000000+00:00 app[api]: Build started by user tahirdovtalabi@gmail.com
2020-03-14T05:41:03.416583+00:00 app[api]: Deploy 8ca20b00 by user tahirdovtalabi@gmail.com
2020-03-14T05:41:03.416583+00:00 app[api]: Release v13 created by user tahirdovtalabi@gmail.com
2020-03-14T05:41:04.764521+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-14T05:41:08.640997+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -cp ./target/classes:target/deps/* App`
2020-03-14T05:41:10.482544+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-14T05:41:10.466473+00:00 heroku[web.1]: Process exited with status 1
2020-03-14T05:41:10.342821+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-14T05:41:10.346460+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-03-14T05:41:10.416186+00:00 app[web.1]: Error: Could not find or load main class App
2020-03-14T05:41:16.000000+00:00 app[api]: Build succeeded
2020-03-14T05:41:27.670246+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=69ba0690-8461-4a45-be74-44fdaea0065f fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T05:41:28.319998+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=teacherapppostgres.herokuapp.com request_id=c7cd10c5-08cd-4572-a8b9-d09568aed226 fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T05:42:51.000000+00:00 app[api]: Build started by user tahirdovtalabi@gmail.com
2020-03-14T05:43:35.892349+00:00 app[api]: Release v14 created by user tahirdovtalabi@gmail.com
2020-03-14T05:43:35.892349+00:00 app[api]: Deploy b6b5bdac by user tahirdovtalabi@gmail.com
2020-03-14T05:43:37.071771+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-14T05:43:41.426438+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -cp ./target/classes:target/deps/* App`
2020-03-14T05:43:43.579663+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-14T05:43:43.565455+00:00 heroku[web.1]: Process exited with status 1
2020-03-14T05:43:43.403149+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-14T05:43:43.407145+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-03-14T05:43:43.497392+00:00 app[web.1]: Error: Could not find or load main class App
2020-03-14T05:43:46.000000+00:00 app[api]: Build succeeded
2020-03-14T05:43:50.983806+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=dbf473a1-5b03-49c2-887d-bca3cbac27c4 fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T05:43:51.793855+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=teacherapppostgres.herokuapp.com request_id=a3fdeea3-fc62-4040-bd0d-9b8cfe25861b fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T05:54:55.000000+00:00 app[api]: Build started by user tahirdovtalabi@gmail.com
2020-03-14T05:55:39.570727+00:00 app[api]: Deploy 1e18fb4c by user tahirdovtalabi@gmail.com
2020-03-14T05:55:39.570727+00:00 app[api]: Release v15 created by user tahirdovtalabi@gmail.com
2020-03-14T05:55:41.075227+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-14T05:55:45.182483+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -cp ./target/classes:target/dependencies/* App`
2020-03-14T05:55:47.548861+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-14T05:55:47.626742+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-14T05:55:47.535546+00:00 heroku[web.1]: Process exited with status 1
2020-03-14T05:55:47.352533+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-14T05:55:47.356309+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-03-14T05:55:47.482946+00:00 app[web.1]: Error: Could not find or load main class App
2020-03-14T05:55:50.000000+00:00 app[api]: Build succeeded
2020-03-14T05:55:51.686133+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -cp ./target/classes:target/dependencies/* App`
2020-03-14T05:55:53.745648+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-14T05:55:53.724297+00:00 heroku[web.1]: Process exited with status 1
2020-03-14T05:55:53.581714+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-14T05:55:53.586365+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-03-14T05:55:53.670426+00:00 app[web.1]: Error: Could not find or load main class App
2020-03-14T05:56:15.095467+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=98ae992f-bf5a-4104-93eb-72049526416d fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T05:56:15.655077+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=teacherapppostgres.herokuapp.com request_id=729c0363-1ecd-4f28-8c79-fe144a842f82 fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T05:58:55.540450+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=561bf325-e394-4827-823a-5fbb7ad0bf3a fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T05:58:56.259839+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=teacherapppostgres.herokuapp.com request_id=debaa41e-105d-4030-ae21-8db982c3a198 fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T06:12:04.243410+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=HEAD path="/" host=teacherapppostgres.herokuapp.com request_id=d428f7ce-1b12-49d8-8b1a-743b7838f546 fwd="217.182.175.162" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T06:14:34.505673+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/robots.txt" host=teacherapppostgres.herokuapp.com request_id=310d1b19-a348-4701-8d11-6d03941b35ea fwd="107.23.92.82" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T06:14:34.799351+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=d2a07207-bc88-437c-a539-519e56cdefa5 fwd="107.23.92.82" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T06:35:34.068777+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-14T06:35:37.856825+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -cp ./target/classes:target/dependencies/* App`
2020-03-14T06:35:39.912936+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-14T06:35:39.899439+00:00 heroku[web.1]: Process exited with status 1
2020-03-14T06:35:39.776927+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-14T06:35:39.780635+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-03-14T06:35:39.860070+00:00 app[web.1]: Error: Could not find or load main class App
2020-03-14T07:48:10.606805+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-14T07:48:15.205701+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -cp ./target/classes:target/dependencies/* App`
2020-03-14T07:48:18.258407+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-14T07:48:18.238357+00:00 heroku[web.1]: Process exited with status 1
2020-03-14T07:48:17.989270+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-14T07:48:17.994888+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-03-14T07:48:18.149467+00:00 app[web.1]: Error: Could not find or load main class App
2020-03-14T09:24:29.542993+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=c9242549-9f82-49c2-bff0-402e991090c1 fwd="3.80.154.81" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:29.456475+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=e06dceca-9b33-49da-be55-4e5bf55c662d fwd="34.204.17.218" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:29.762927+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=6600f640-ddfc-4824-8507-92962ef1da27 fwd="34.204.17.218" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:32.613229+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=HEAD path="/" host=teacherapppostgres.herokuapp.com request_id=f5dca397-a344-4c4b-b4f1-5436f78118b8 fwd="208.79.212.98" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:32.916894+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=93fd714a-140e-40b8-a935-b5c85decbb9f fwd="54.174.68.147" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:33.326870+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=191a3b62-e6c9-4844-9f13-416b39e614a9 fwd="34.206.217.125" dyno= connect= service= status=503 bytes= protocol=http
2020-03-14T09:24:33.427801+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=da74fcbb-59a6-480f-b8a4-6c79ae833048 fwd="52.42.250.87" dyno= connect= service= status=503 bytes= protocol=http
2020-03-14T09:24:35.388877+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/robots.txt" host=teacherapppostgres.herokuapp.com request_id=44488957-b317-4730-91b0-7d0d22591d53 fwd="3.208.220.200" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:35.622147+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=b2100c10-d391-4fe1-9ee3-a5157d29e7d0 fwd="3.208.220.200" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:35.847776+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/robots.txt" host=teacherapppostgres.herokuapp.com request_id=0af7aaef-c29a-44d3-ac5a-f3608c792b05 fwd="3.217.157.17" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:36.099384+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=a8661628-897b-47c5-a6ed-3dc844f81852 fwd="3.217.157.17" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:41.131648+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=5e7f0433-d023-4f66-b0c0-bb239b035a71 fwd="185.20.6.61" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:50.320393+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=1e1b4a9c-cd97-413b-b392-42e4483e6d5f fwd="18.234.166.227" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:24:50.331623+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=8b5374bd-bf41-4214-a47b-e51df52e60f5 fwd="18.234.166.227" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:25:14.458723+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=7bda0a8b-d649-41b2-9162-831f170bd0be fwd="34.239.129.239" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:25:14.465085+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=d9614d78-0bc4-428c-9556-c4cea25b3a39 fwd="52.87.241.197" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:25:14.765797+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=55d9e19d-b240-4c11-a426-700229ee57a7 fwd="34.239.129.239" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:29:27.534158+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-14T09:29:31.094889+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -cp ./target/classes:target/dependencies/* App`
2020-03-14T09:29:32.966855+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-14T09:29:32.953197+00:00 heroku[web.1]: Process exited with status 1
2020-03-14T09:29:32.729346+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-14T09:29:32.732679+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-03-14T09:29:32.825771+00:00 app[web.1]: Error: Could not find or load main class App
2020-03-14T09:29:46.901922+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=HEAD path="/" host=teacherapppostgres.herokuapp.com request_id=59a0a257-a68a-4131-bd58-6196d559381d fwd="213.239.218.163" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:30:49.159001+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teacherapppostgres.herokuapp.com request_id=332c9fa5-c9e7-4638-974e-9426f13d5f30 fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T09:30:49.499722+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=teacherapppostgres.herokuapp.com request_id=9211ed84-1af8-4633-a3bd-5e4bc8d28fcc fwd="5.197.218.107" dyno= connect= service= status=503 bytes= protocol=https

这是我的个人资料:

web: java $JAVA_OPTS -cp ./target/classes:target/dependencies/* App

这是我的 pom.xml:

<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.example</groupId>
<artifactId>TeacherApp</artifactId>
<version>1.0-SNAPSHOT</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
</parent>
<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-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.4.0-b180830.0359</version>
</dependency>
<dependency>

<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.8</version>
<scope>runtime</scope>

</dependency>
</dependencies>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>App</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

这是我的文件夹目标文件夹结构:

Folder Sturcture

最佳答案

我解决了这个问题。我的应用程序缺少 MANIFEST.MF,并且在部署之前忘记了构建。完成这些操作并编辑 Procfile 后,应用程序工作正常。

关于java - 单击“打开应用程序”时,heroku 应用程序错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60680232/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com