无法在heroku

时间:2017-03-31 09:28:10

标签: java heroku activejdbc javalite

我有我的procfile:

web: java -cp target/classes:target/dependency/* com.888.888.Application

连接详情:

Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://o3iyl77734btg.cbetxkdyhwsb.us-east-1.rds.amazonaws.com/lt9vgms3ueidoa", "nt2qniqiuhl67", "k2dijxt3xcf9o");

POM:

    

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <configuration>
            <mainClass>com.soul.seeker.Application</mainClass>
            <arguments>
            </arguments>
        </configuration>
    </plugin>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.0</version>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <encoding>UTF-8</encoding>
        </configuration>
    </plugin>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.4</version>
        <executions>
            <execution>
                <id>copy-dependencies</id>
                <phase>package</phase>
                <goals>
                    <goal>copy-dependencies</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

    <plugin>
        <groupId>org.javalite</groupId>
        <artifactId>activejdbc-instrumentation</artifactId>
        <version>${activejdbc.version}</version>
        <executions>
            <execution>
                <phase>process-classes</phase>
                <goals>
                    <goal>instrument</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
</plugins>

Heroku日志--tail:

2017-03-31T08:53:35.035665+00:00 app[api]: Starting process with command `java console` by user .k999@gmail.com
2017-03-31T08:59:37.504808+00:00 heroku[web.1]: State changed from crashed to starting
2017-03-31T08:59:40.018376+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -Dserver.port=8577 -jar target/*.jar`
2017-03-31T08:59:42.220679+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2017-03-31T08:59:42.224224+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx350m -Xss512k -Dfile.encoding=UTF-8
2017-03-31T08:59:42.338167+00:00 app[web.1]: no main manifest attribute, in target/seeker_Java_Spark-1.0-SNAPSHOT.jar
2017-03-31T08:59:42.441817+00:00 heroku[web.1]: Process exited with status 1
2017-03-31T08:59:42.456928+00:00 heroku[web.1]: State changed from starting to crashed
2017-03-31T09:14:41.000000+00:00 app[api]: Build started by user .k999@gmail.com
2017-03-31T09:14:59.771140+00:00 app[api]: Release v13 created by user .k999@gmail.com
2017-03-31T09:14:59.771140+00:00 app[api]: Deploy db9bb50 by user .k999@gmail.com
2017-03-31T09:14:41.000000+00:00 app[api]: Build succeeded
2017-03-31T09:15:00.343156+00:00 app[api]: Release v13 created by user .k999@gmail.com
2017-03-31T09:15:00.464317+00:00 heroku[web.1]: State changed from crashed to starting
2017-03-31T09:15:03.852306+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -Dserver.port=30122 -jar target/*.jar`
2017-03-31T09:15:06.100736+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2017-03-31T09:15:06.106289+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx350m -Xss512k -Dfile.encoding=UTF-8
2017-03-31T09:15:06.253188+00:00 app[web.1]: no main manifest attribute, in target/seeker_Java_Spark-1.0-SNAPSHOT.jar
2017-03-31T09:15:06.338012+00:00 heroku[web.1]: State changed from starting to crashed
2017-03-31T09:15:06.339425+00:00 heroku[web.1]: State changed from crashed to starting
2017-03-31T09:15:06.329112+00:00 heroku[web.1]: Process exited with status 1
2017-03-31T09:15:09.463349+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -Dserver.port=49453 -jar target/*.jar`
2017-03-31T09:15:12.032819+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2017-03-31T09:15:12.037084+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx350m -Xss512k -Dfile.encoding=UTF-8
2017-03-31T09:15:12.129561+00:00 app[web.1]: no main manifest attribute, in target/seeker_Java_Spark-1.0-SNAPSHOT.jar
2017-03-31T09:15:12.210338+00:00 heroku[web.1]: Process exited with status 1
2017-03-31T09:15:12.220183+00:00 heroku[web.1]: State changed from starting to crashed
2017-03-31T09:15:55.312322+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="//getRecent" host=seeker-java-spark.herokuapp.com request_id=7df2a77a-8a78-43a3-874b-8ecbf394653d fwd="54.224.180.207" dyno= connect= service= status=503 bytes= protocol=https
2017-03-31T09:16:01.138972+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="//data_on_page_load?limit=4&offset=0" host=seeker-java-spark.herokuapp.com request_id=b8ff2299-bd1d-435b-bf84-e358ca9d44f6 fwd="54.224.180.207" dyno= connect= service= status=503 bytes= protoc
l=https
2017-03-31T09:17:06.000000+00:00 app[api]: Build started by user .k999@gmail.com
2017-03-31T09:17:23.683130+00:00 app[api]: Deploy 4968a29 by user .k999@gmail.com
2017-03-31T09:17:23.683130+00:00 app[api]: Release v14 created by user .k999@gmail.com
2017-03-31T09:17:24.061692+00:00 app[api]: Release v14 created by user .k999@gmail.com
2017-03-31T09:17:06.000000+00:00 app[api]: Build succeeded
2017-03-31T09:17:24.717686+00:00 heroku[web.1]: State changed from crashed to starting
2017-03-31T09:17:27.559351+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -Dserver.port=38303 -jar target/*.jar`
2017-03-31T09:17:29.517107+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2017-03-31T09:17:29.520526+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx350m -Xss512k -Dfile.encoding=UTF-8
2017-03-31T09:17:29.605348+00:00 app[web.1]: no main manifest attribute, in target/seeker_Java_Spark-1.0-SNAPSHOT.jar
2017-03-31T09:17:29.727476+00:00 heroku[web.1]: State changed from starting to crashed
2017-03-31T09:17:29.720959+00:00 heroku[web.1]: Process exited with status 1
^CTerminate batch job (Y/N)? y

heroku java console命令:运行此命令显示未找到主类但我已正确声明了proc文件,我不知道它为什么不起作用。

E:\WORKSPACE\NETBEANS_WORKSPACE\seeker_Java_Spark>heroku run java console
Running java console on seeker-java-spark... up, run.4407 (Free)
Error: Could not find or load main class console

1 个答案:

答案 0 :(得分:1)

Heroku正尝试使用java $JAVA_OPTS -Dserver.port=30122 -jar target/*.jar命令运行您的应用。

通过运行Procfile检查您的git ls-files是否已通过Git检查。

我不知道heroku run java console应该是什么。这不是我见过的命令。