无法部署到Heroku。at=error code=H10 desc="应用程序崩溃"。

5

我正在尝试将我的应用程序部署到Heroku,但我的应用程序已经崩溃了。以下是错误信息:

at=error code=H10 desc="App crashed" method=GET path="/" 
host=smartmed2017.herokuapp.com request_id=3e8cc17e-320b-4230-bdbb-
3a751e3477de fwd="195.19.247.73" dyno= connect= service= status=503 
bytes= protocol=https

2017-06-01T11:17:42.380548+00:00 heroku[router]: at=error code=H10 
desc="App crashed" method=GET path="/favicon.ico" 
host=smartmed2017.herokuapp.com request_id=9ab6574e-3fed-4af3-9cae-
0651e13d9112 fwd="195.19.247.73" dyno= connect= service= status=503 
bytes= protocol=https

通常情况下,但是这个问题的原因可能不同。

这是Main.class文件。

@Controller
@SpringBootApplication
public class Main
{
    public static void main(String[] args) throws Exception {
        SpringApplication.run(Main.class, args);
    }

    @RequestMapping("/")
    String index() {
        return "index";
    }
}

Procfile:

web: java -Dserver.port=$PORT -jar target/untitled-1.0-SNAPSHOT.jar

Screenshot of my classes and pages here


1
在重新启动Dyno后,您能否运行heroku logs -t并捕获JVM的错误消息? - codefinger
@codefinger 在这里。感谢您的回复。 - Vlad Yurevich
你发布的日志不够详细。 尝试从开头复制日志,让我们看看可能发生了什么。如果你有一个连接到 localhost 的数据库,请检查并更改端口。 你是否在 pom.xml 中添加了 webapp-runner? - Olakunle Awotunbo
@AwotunboOlakunleOladeji 我还没有使用任何数据库。第一张截图第二张截图。我没有这个。谢谢你的帮助! - Vlad Yurevich
@AwotunboOlakunleOladeji 我没有webapp-runner,我的意思是... - Vlad Yurevich
2个回答

3
H10错误的意思是: Web dyno崩溃或Web dyno引导超时将出现此错误。根据java-webapp-runner
  1. Add webapp runner to the plugins section in your pom.xml

     <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.3</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals><goal>copy</goal></goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>com.github.jsimone</groupId>
                                <artifactId>webapp-runner</artifactId>
                                <version>8.5.11.3</version>
                                <destFileName>webapp-runner.jar</destFileName>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    
  2. Change your Procfile to

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

然后尝试重新部署。

如果需要更多帮助,请查看我在GitHub上部署的示例项目 Heroku上的示例项目

你可以分享一下在GitHub上的项目吗?


这里是repo:https://github.com/vladyour/SmartMed2017.git 你可以看到logfile.txt,在那里你会看到更改后的错误。 - Vlad Yurevich

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接