Java 将spring mvc网站部署到Heroku时应用程序崩溃

Java 将spring mvc网站部署到Heroku时应用程序崩溃,java,spring,spring-mvc,heroku,Java,Spring,Spring Mvc,Heroku,我正试图将我的spring mvc项目部署到Heroku,但出现以下错误: 2015-07-14T22:42:49.088312+00:00 heroku[web.1]: Process exited with status 1 2015-07-14T22:42:49.101203+00:00 heroku[web.1]: State changed from starting to crashed 2015-07-14T22:43:31.905877+00:00 heroku[router]:

我正试图将我的spring mvc项目部署到Heroku,但出现以下错误:

2015-07-14T22:42:49.088312+00:00 heroku[web.1]: Process exited with status 1
2015-07-14T22:42:49.101203+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-14T22:43:31.905877+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=hops.herokuapp.com request_id=befdaefa-cb1e-4560-a190-c532a339531b fwd="70.73.71.223" dyno= connect= service= status=503 bytes=
2015-07-14T22:43:32.769807+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=hops.herokuapp.com request_id=c04566c1-7b09-4b45-8f64-497601415823 fwd="70.73.71.223" dyno= connect= service= status=503 bytes=
我已尝试运行heroku run rails控制台,但出现以下错误:

Your version of git is 1.9.3. Which has serious security vulnerabilities.
More information here: https://blog.heroku.com/archives/2014/12/23/update_your_git_clients_on_windows_and_os_x
Running `rails console` attached to terminal... up, run.8780
bash: rails: command not found
这就是我的Procfile的外观:

web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war
我已经遵循了这个网站上的说明,但我不知道如何让我的网站启动和运行。

是否有其他网站可以轻松部署我的网站,或者是否有人知道如何修复此错误。任何帮助都将不胜感激

更新

运行foreman start web时,显示以下输出:

started with pid 7510
17:18:59 web.1  | Error: Unable to access jarfile target/dependency/jetty-runner.jar
17:18:59 web.1  | exited with code 1
17:18:59 system | sending SIGTERM to all processes
在pom.xml中显示的jetty的依赖项如下所示:

<dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-runner</artifactId>
            <version>8.1.16.v20140903</version>
        </dependency>
    </dependencies>

org.mortbay.jetty
码头转轮
8.1.16.v20140903

我不知道如何准确地解决这个问题,也不知道它为什么会产生这个错误。

重复评论中的内容,以便将其标记为已回答

您需要添加以下插件配置:

  <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</goal></goals>
            <configuration>
                <artifactItems>
                    <artifactItem>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-runner</artifactId>
                        <version>9.2.7.v20150116</version>
                        <destFileName>jetty-runner.jar</destFileName>
                    </artifactItem>
                </artifactItems>
            </configuration>
      </execution>
    </executions>
  </plugin>

org.apache.maven.plugins
maven依赖插件
2.4
复制依赖项
包裹
复制
org.eclipse.jetty
码头转轮
9.2.7.v20150116
jetty-runner.jar

这将把jetty runner复制到slug中,以便在运行时使用。

应用程序日志会怎么说?使用heroku日志--source app进行筛选。此外,如果您没有运行RubyonRails应用程序,
rails控制台
将不起作用。如果您想深入了解heroku文件系统,可以通过heroku run bash获得远程shell。多了解一下你的应用程序的功能(它是否依赖于数据库?如何配置?)也会有助于调试。我试过运行英雄日志——源应用程序,它只说存在安全漏洞,但没有说明任何错误。对于远程shell,我不知道该怎么做。有没有其他网站可以很容易地部署这种类型的项目,而不要求提供信用卡信息?我想system ruby是预装在mac上的?如果没有,我如何安装它,找到我的问题的根源。谢谢你的帮助。你能用
foreman start web
在本地运行你的应用程序吗?我运行了这个命令,它给了我以下错误:错误:无法访问jarfile target/dependency/jetty-runner.jar。我将jetty runner作为依赖项添加到我的spring mvc pom.xml文件中,就像heroku上所说的那样。