2017-06-01 135 views
0

我试图将我的应用程序部署到Heroku。我的应用程序崩溃了。这是错误:无法部署到Heroku。 at =错误代码= H10 desc =“应用程序崩溃”

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并从JVM捕获错误消息后,可以运行'heroku logs -t'吗? – codefinger

+0

@codefinger [here](https://drive.google.com/open?id=0Bxr_GNWk2oo0b3RJLW5OQU1SWG8)。感谢您的回复 –

+0

您发布的日志不够详细。 尝试从头开始复制日志,让我们看看可能发生了什么。 如果您有数据库连接到本地主机,请检查并更改端口。 你有没有将webapp-runner添加到pom.xml中? –

回答

2

H10错误是指:甲坠毁幅DYNO或在卷筒纸DYNO一个启动超时会呈现这个错误。 据java-webapp-runner

  1. 在你的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. 更改Procfile添加web应用亚军的插件部分

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

然后尝试重新部署。

看看这个项目,我部署在github上,如果它可以帮助你更多Sample Project on Heroku

你可以在github上分享项目吗?

+0

[这里是回购](https://github.com/vladyour/SmartMed2017.git) 在那里你会看到logfile.txt。更改后有错误 –

相关问题