Heroku(無料)へEclipseで作成したwarファイルをデプロイしましたが、404エラーとなってしまいます。
Eclipseにて作成したJavaServletプロジェクトをHerokuにデプロイしたいと考えています。
localサーバ上では以下の通りに動くプロジェクトです。
http://localhost:8080/TypingQuiz/Pack
コンテキストルート:TypingQuiz
@WebServletアノテーション:Pack
上記を実行すると、ServletがdoGetにて「index.jsp」にdispatcher.forwardを行い、index.jspを表示しています。
これをHerokuにデプロイしようと思い、以下の手順にてデプロイを行いました。
1WARファイルの作成
Eclipse→プロジェクトで右クリック→Tomcatプロジェクト→このプロジェクト設定に従いwarファイルを作成
コンテキスト名:TypingQuiz
warエクスポート設定:/Users/ユーザ名/Desktop/test.war
2WARファイルのデプロイ
heroku deploy:war --war /Users/ユーザ名/Desktop/test.war --app test428978000
test428978000:createしたHerokuプロジェクト
上記実行後に以下のURLへアクセスしましたが404エラーが出てしまいます。
URL
https://test428978000.herokuapp.com/
Error
Type Status Report
Message /
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
以下も試しましたが同様のメッセージが出力されます。
https://test428978000.herokuapp.com/TypingQuiz/Pack
Type Status Report
Message /TypingQuiz/Pack
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
localhostとHerokuとでコンテキストルートの設定等で何か違いがあるのでしょうか。
同じような事象になった方や、ここが怪しいのではないかなどアドバイスをいただけますと幸いです。
よろしくお願いいたします。
Heroku log
2017-11-05T05:37:24.726500+00:00 heroku[router]: at=info method=GET path="/" host=test428978000.herokuapp.com request_id=8fb8f589-d483-42c1-9fdd-5a02ca5ddc2b fwd="60.120.49.207" dyno=web.1 connect=0ms service=4ms status=404 bytes=1226 protocol=https
20171106 実行ログ追記
2017-11-06T12:58:30.926429+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2017-11-06T12:58:30.931916+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -Dfile.encoding=UTF-8
2017-11-06T12:58:31.286612+00:00 app[web.1]: Expanding TypingQuiz.war into /app/target/tomcat.59041/webapps/expanded
2017-11-06T12:58:31.286656+00:00 app[web.1]: Adding Context for /app/target/tomcat.59041/webapps/expanded
2017-11-06T12:58:31.590698+00:00 app[web.1]: Nov 06, 2017 12:58:31 PM org.apache.coyote.AbstractProtocol init
2017-11-06T12:58:31.590711+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["http-nio-59041"]
2017-11-06T12:58:31.612899+00:00 app[web.1]: Nov 06, 2017 12:58:31 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
2017-11-06T12:58:31.612902+00:00 app[web.1]: INFO: Using a shared selector for servlet write/read
2017-11-06T12:58:31.616632+00:00 app[web.1]: Nov 06, 2017 12:58:31 PM org.apache.catalina.core.StandardService startInternal
2017-11-06T12:58:31.616634+00:00 app[web.1]: INFO: Starting service [Tomcat]
2017-11-06T12:58:31.617454+00:00 app[web.1]: Nov 06, 2017 12:58:31 PM org.apache.catalina.core.StandardEngine startInternal
2017-11-06T12:58:31.617456+00:00 app[web.1]: INFO: Starting Servlet Engine: Apache Tomcat/8.5.23
2017-11-06T12:58:31.742801+00:00 app[web.1]: Nov 06, 2017 12:58:31 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
2017-11-06T12:58:31.742803+00:00 app[web.1]: INFO: No global web.xml found
2017-11-06T12:58:32.204691+00:00 app[web.1]: Nov 06, 2017 12:58:32 PM org.apache.jasper.servlet.TldScanner scanJars
2017-11-06T12:58:32.204713+00:00 app[web.1]: INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2017-11-06T12:58:32.240898+00:00 app[web.1]: Nov 06, 2017 12:58:32 PM org.apache.coyote.AbstractProtocol start
2017-11-06T12:58:32.240904+00:00 app[web.1]: INFO: Starting ProtocolHandler ["http-nio-59041"]
2017-11-06T12:58:32.730740+00:00 heroku[web.1]: State changed from starting to up
あなたの回答
tips
プレビュー