首页 > 解决方案 > heroku 本地网络未处理

问题描述

我正在尝试在 heroku 上运行我的电报机器人,但目前在我输入之后

heroku local web

在 git 内部,它似乎并没有终止或实际上在屏幕上做任何事情

截图在这里

到目前为止我做了什么

1)按照这里的说明https://devcenter.heroku.com/articles/preparing-a-codebase-for-heroku-deployment

2)确保我的 pom.xml 文件具有正确的依赖项(下面的代码段)。

    <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>

    <dependency>
        <groupId>com.vdurmont</groupId>
        <artifactId>emoji-java</artifactId>
        <version>3.1.3</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.6.1</version>
    </dependency>

    <dependency>
        <groupId>org.telegram</groupId>
        <artifactId>telegrambots</artifactId>
        <version>4.8.1</version>
    </dependency>
</dependencies>

<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>Main</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
        </plugin>

    </plugins>
</build>

3)玩弄 Procfile heroku 需要(如下所示)

web: java -jar target/FastFoodSG-1.0-SNAPSHOT-jar-with-dependencies.jar

4)作为参考,这是它应该看起来的样子

正确的输出

5)这里也是日志

    $ heroku logs
2020-05-11T15:16:29.419323+00:00 app[api]: Initial release by user 
2020-05-11T15:16:29.419323+00:00 app[api]: Release v1 created by user 
2020-05-11T15:16:29.705740+00:00 app[api]: Enable Logplex by user 
2020-05-11T15:16:29.705740+00:00 app[api]: Release v2 created by user 
2020-05-11T15:17:52.108575+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=morning-savannah-53078.herokuapp.com request_id=73771d98-12d8-49da-bda3-6cc7244e1b2a fwd="27.104.218.25" dyno= connect= service= status=502 bytes= protocol=https
2020-05-11T15:17:52.447922+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=morning-savannah-53078.herokuapp.com request_id=4328e93a-859f-4565-96d5-e494e2eb422c fwd="27.104.218.25" dyno= connect= service= status=502 bytes= protocol=https
2020-05-11T15:18:47.000000+00:00 app[api]: Build started by user 
2020-05-11T15:19:12.353237+00:00 app[api]: Scaled to web@1:Free by user 
2020-05-11T15:19:12.338863+00:00 app[api]: Deploy e8a60df3 by user 
2020-05-11T15:19:12.338863+00:00 app[api]: Release v3 created by user 
2020-05-11T15:19:15.000000+00:00 app[api]: Build succeeded
2020-05-11T15:19:17.788241+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-11T15:19:17.791251+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-11T15:19:17.588270+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-05-11T15:19:17.592202+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-05-11T15:19:17.720108+00:00 app[web.1]: no main manifest attribute, in target/FastFoodSG-1.0-SNAPSHOT.jar
2020-05-11T15:19:25.325228+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-11T15:19:25.212848+00:00 app[web.1]: no main manifest attribute, in target/FastFoodSG-1.0-SNAPSHOT.jar
2020-05-11T15:19:24.936872+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-05-11T15:19:24.978320+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-05-11T15:19:26.458157+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=morning-savannah-53078.herokuapp.com request_id=29fad18f-744a-4c72-b15a-61970679dd53 fwd="27.104.218.25" dyno= connect= service= status=503 bytes= protocol=https
2020-05-11T15:19:26.852066+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=morning-savannah-53078.herokuapp.com request_id=32fce934-f6d9-4f88-8daa-0e15e2078cc9 fwd="27.104.218.25" dyno= connect= service= status=503 bytes= protocol=https

标签: javaherokutelegram-bot

解决方案


推荐阅读