前提
eclpseでプロジェクトのwarファイルをエクスポートしてherokuでデプロイしましたが404エラーがでます。ローカルでは動作確認できています。フォワードして白紙のページを表示するだけアプリです。https://youtu.be/nGQlDcwH0bkこの動画の通りにやったのですがうまくいきませんでした。warファイルをエクスポートしたときにプロジェクトの中にwarファイルが作成されなかったことと、コマンドプロンプトで最初に打っているコマンドの意味がよくわからなかったので、そのあたりに原因があるのかなと自分では思っているのですが知識不足で分かりません。
###実現したいこと
herokuでJavaアプリをデプロイしたい
発生している問題・エラーメッセージ
2022-09-01T07:19:05.360811+00:00 app[web.1]: Sep 01, 2022 7:19:05 AM org.apache.catalina.core.StandardEngine startInternal
2022-09-01T07:19:05.360813+00:00 app[web.1]: INFO: Starting Servlet engine: [Apache Tomcat/9.0.30]
2022-09-01T07:19:05.476612+00:00 app[web.1]: Sep 01, 2022 7:19:05 AM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
2022-09-01T07:19:05.476616+00:00 app[web.1]: INFO: No global web.xml found
2022-09-01T07:19:05.727074+00:00 heroku[web.1]: State changed from starting to up
2022-09-01T07:19:10.339661+00:00 app[web.1]: Sep 01, 2022 7:19:10 AM org.apache.jasper.servlet.TldScanner scanJars
2022-09-01T07:19:10.339668+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.
2022-09-01T07:19:10.391325+00:00 app[web.1]: Sep 01, 2022 7:19:10 AM org.apache.coyote.AbstractProtocol start
2022-09-01T07:19:10.391327+00:00 app[web.1]: INFO: Starting ProtocolHandler ["http-nio-49898"]
2022-09-01T07:19:10.463204+00:00 heroku[router]: at=info method=GET path="/" host=java-hite.herokuapp.com request_id=793a04de-5f29-4512-8616-8d89fd87496b fwd="153.246.140.214" dyno=web.1 connect=0ms service=3023ms status=404 bytes=864 protocol=https
補足情報(FW/ツールのバージョンなど)
java17 tomcat9
サーブレット
package
1 2import java.io.IOException; 3 4import javax.servlet.RequestDispatcher; 5import javax.servlet.ServletException; 6import javax.servlet.annotation.WebServlet; 7import javax.servlet.http.HttpServlet; 8import javax.servlet.http.HttpServletRequest; 9import javax.servlet.http.HttpServletResponse; 10 11/** 12* Servlet implementation class See 13*/ 14@WebServlet("/See") 15public class See extends HttpServlet { 16private static final long serialVersionUID = 1L; 17 18/** 19* @see HttpServlet#HttpServlet() 20*/ 21public See() { 22super(); 23// TODO Auto-generated constructor stub 24} 25
NewFile.jsp
1>>> 2<%@ page language="java" contentType="text/html; charset=UTF-8" 3pageEncoding="UTF-8"%> 4<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 5<html> 6<head> 7<meta http-equiv="Content-Type"content="text/html;charset"=UTF-8"> 8<title>Insert title here</title> 9</head> 10<body> 11 12</body> 13</html>
あなたの回答
tips
プレビュー