2016-11-21 14 views
0

私は簡単なSpringMVC REST APIをHerokuに配備しようとしています - 私はgithubのサンプルコードを持っています。私はHerokuのにデプロイすると、アプリが動作しない - これは私がHerokuの上のログファイルに見えるものです:Heroku - H10 "app crash"のSpringブート

2016-11-21T00:28:28.965526+00:00 app[web.1]: at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138) 2016-11-21T00:28:28.965587+00:00 app[web.1]: at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:121) 2016-11-21T00:28:28.965642+00:00 app[web.1]: at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:63) 2016-11-21T00:28:28.965701+00:00 app[web.1]: at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:48) 2016-11-21T00:28:28.965762+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:304) 2016-11-21T00:28:28.965804+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) 2016-11-21T00:28:28.965865+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) 2016-11-21T00:28:28.965926+00:00 app[web.1]: at com.jkerak.TodoApiApplication.main(TodoApiApplication.java:9) 2016-11-21T00:28:28.965989+00:00 app[web.1]: ... 8 more 2016-11-21T00:28:29.096742+00:00 heroku[web.1]: State changed from starting to crashed 2016-11-21T00:28:29.081552+00:00 heroku[web.1]: Process exited with status 1 2016-11-21T00:51:54.625237+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=jkerak-todoapi.herokuapp.com request_id=73c76e69-2084-436f-b829-dd533562d13a fwd="73.30.84.74" dyno= connect= service= status=503 bytes=

私はローカルでアプリを実行している問題はありません。

Herokuで何がうまくいかないのかについての詳しい情報にアクセスできる場所はありますか?私は、「Github配備」パイプラインを使ってアプリケーションを配備しています。

答えて

1

投稿したログは切り捨てられます(heroku logs -n 2000 -a youappを実行するとログが増えます)。しかし、Githubのコードを使って、エラーが見つかりました:

Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.SimpleLoggerFactory loaded from jar:file:/app/target/todoApi-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/slf4j-simple-1.7.21.jar!/). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.slf4j.impl.SimpleLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext

クラスパスにエラーがあります。私は、クラスパスの順序が非決定的であるため、これがローカルでは起こらないと考えています。

あなたの依存関係からslf4j-simple-1.7.21を削除してみてください。これを行うには、swagger-codegenの依存関係を次のように変更します。

<dependency> 
    <groupId>io.swagger</groupId> 
    <artifactId>swagger-codegen</artifactId> 
    <version>2.2.1</version> 
    <exclusions> 
    <exclusion> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-simple</artifactId> 
    </exclusion> 
    </exclusions> 
</dependency> 
+0

これは完全に実行されました - ありがとう、私は稼働しています。 – jkerak

関連する問題