Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 向Heroku启动Dropwizard项目失败_Java_Maven_Heroku_Dropwizard - Fatal编程技术网

Java 向Heroku启动Dropwizard项目失败

Java 向Heroku启动Dropwizard项目失败,java,maven,heroku,dropwizard,Java,Maven,Heroku,Dropwizard,我在Dropwizard中创建了一个小项目,它在本地环境中运行良好,但在Heroku中无法启动 这是heroku日志: 2013-07-24T23:09:40+00:00 heroku[slug-compiler]: Slug compilation started ←[33m2013-07-24T23:10:54.174260+00:00 heroku[api]:←[0m Deploy 571955a by XXXXXXX ←[33m2013-07-24T23:10:54.201000+00:

我在Dropwizard中创建了一个小项目,它在本地环境中运行良好,但在Heroku中无法启动

这是heroku日志:

2013-07-24T23:09:40+00:00 heroku[slug-compiler]: Slug compilation started
←[33m2013-07-24T23:10:54.174260+00:00 heroku[api]:←[0m Deploy 571955a by XXXXXXX
←[33m2013-07-24T23:10:54.201000+00:00 heroku[api]:←[0m Release v11 created by XXXXXXX
←[33m2013-07-24T23:10:54.240600+00:00 heroku[api]:←[0m Deploy 571955a by XXXXXXX
←[36m2013-07-24T23:10:54.334655+00:00 heroku[web.1]:←[0m State changed from crashed to starting
2013-07-24T23:10:54+00:00 heroku[slug-compiler]: Slug compilation finished
←[36m2013-07-24T23:10:59.375716+00:00 heroku[web.1]:←[0m Starting process with command `java -Xmx384m -Xss512k -XX:+UseCompressedOops -Ddw.http.port=23934 -Ddw.http.adminPort=23934 -jar target\MachineSounds-1.0-SNAPSHOT.jar server`
←[36m2013-07-24T23:10:59.952116+00:00 app[web.1]:←[0m Error: Unable to access jarfile targetMachineSounds-1.0-SNAPSHOT.jar
←[36m2013-07-24T23:11:01.529809+00:00 heroku[web.1]:←[0m Process exited with status 1
←[36m2013-07-24T23:11:01.541446+00:00 heroku[web.1]:←[0m State changed from starting to crashed
←[36m2013-07-24T23:18:31.048671+00:00 heroku[web.1]:←[0m State changed from crashed to starting
←[36m2013-07-24T23:18:35.424294+00:00 heroku[web.1]:←[0m Starting process with command `java -Xmx384m -Xss512k -XX:+UseCompressedOops -Ddw.http.port=36844 -Ddw.http.adminPort=36844 -jar target\MachineSounds-1.0-SNAPSHOT.jar server`
←[36m2013-07-24T23:18:36.453362+00:00 app[web.1]:←[0m Error: Unable to access jarfile targetMachineSounds-1.0-SNAPSHOT.jar
←[36m2013-07-24T23:18:37.811693+00:00 heroku[web.1]:←[0m Process exited with status 1
←[36m2013-07-24T23:18:37.830475+00:00 heroku[web.1]:←[0m State changed from starting to crashed
←[36m2013-07-24T23:18:45.661660+00:00 heroku[web.1]:←[0m Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
←[36m2013-07-24T23:18:45.661958+00:00 heroku[web.1]:←[0m Stopping process with SIGKILL
2013-07-24T23:22:23+00:00 heroku[slug-compiler]: Slug compilation started
←[33m2013-07-24T23:23:28.032517+00:00 heroku[api]:←[0m Deploy e37d92a by XXXXXXX
←[33m2013-07-24T23:23:28.066692+00:00 heroku[api]:←[0m Release v12 created by XXXXXXX
←[33m2013-07-24T23:23:28.105725+00:00 heroku[api]:←[0m Deploy e37d92a by XXXXXXX
←[36m2013-07-24T23:23:28.227286+00:00 heroku[web.1]:←[0m State changed from crashed to starting
2013-07-24T23:23:28+00:00 heroku[slug-compiler]: Slug compilation finished
←[36m2013-07-24T23:23:46.284459+00:00 heroku[web.1]:←[0m Starting process with command `java -Xmx384m -Xss512k -XX:+UseCompressedOops -Ddw.http.port=7581 -Ddw.http.adminPort=7581 -jar target\\MachineSounds-1.0-SNAPSHOT.jar server`
←[36m2013-07-24T23:23:47.951811+00:00 app[web.1]:←[0m Error: Unable to access jarfile target\MachineSounds-1.0-SNAPSHOT.jar
←[36m2013-07-24T23:23:50.271475+00:00 heroku[web.1]:←[0m Process exited with status 1
←[36m2013-07-24T23:23:50.290262+00:00 heroku[web.1]:←[0m State changed from starting to crashed
←[36m2013-07-24T23:23:56.613583+00:00 heroku[web.1]:←[0m Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
←[36m2013-07-24T23:23:56.613827+00:00 heroku[web.1]:←[0m Stopping process with SIGKILL
程序文件

 web:    java $JAVA_OPTS -Ddw.http.port=$PORT -Ddw.http.adminPort=$PORT -jar target\\MachineSounds-1.0-SNAPSHOT.jar server
聚甲醛


4.0.0
com.ilopez
机器基金
1.0-快照
机器基金
http://ilopez.com
UTF-8
com.yammer.dropwizard
dropwizard核心
0.6.2
朱尼特
朱尼特
4.4
亚马逊网站
aws java sdk
1.5.1
com.sun.jersey.contribs
泽西多部分
1.17.1
org.apache.maven.plugins
maven依赖插件
2.4
复制依赖项
包裹
复制依赖项
org.apache.maven.plugins
maven阴影插件
1.6
真的
*:*
META-INF/*.SF
META-INF/*.DSA
META-INF/*.RSA
包裹
阴凉处
com.ilopez.machinesounds.ApiService
org.apache.maven.plugins
maven jar插件
2.3.2
真的

jar的路径需要是
目标/MachineSounds-1.0-SNAPSHOT.jar
。Heroku在linux上运行,
/
是路径分隔符。

我需要更多睡眠。谢谢你,迈克尔。
<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>com.ilopez</groupId>
  <artifactId>MachineSounds</artifactId>
  <version>1.0-SNAPSHOT</version>


  <name>MachineSounds</name>
  <url>http://ilopez.com</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>


  <dependencies>    
    <dependency>
        <groupId>com.yammer.dropwizard</groupId>
        <artifactId>dropwizard-core</artifactId>
        <version>0.6.2</version>
    </dependency>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.4</version>
    </dependency> 
    <dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk</artifactId>
    <version>1.5.1</version>
    </dependency>
    <dependency>
    <groupId>com.sun.jersey.contribs</groupId>
    <artifactId>jersey-multipart</artifactId>
    <version>1.17.1</version>
    </dependency>


  </dependencies>

  <build>
      <plugins>
          <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.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>1.6</version>
            <configuration>
                <createDependencyReducedPom>true</createDependencyReducedPom>
                <filters>
                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>META-INF/*.SF</exclude>
                            <exclude>META-INF/*.DSA</exclude>
                            <exclude>META-INF/*.RSA</exclude>
                        </excludes>
                    </filter>
                </filters>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <transformers>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <mainClass>com.ilopez.machinesounds.ApiService</mainClass>
                            </transformer>
                        </transformers>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <archive>
                    <manifest>
                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                    </manifest>
                </archive>
            </configuration>
        </plugin>
      </plugins>
  </build>

</project>