리일리
30
2018-06-14 23:31:05 작성 2018-06-15 00:20:33 수정됨
4
1299

이클립스에서 회원가입을 만드는데 DB에 데이터는 들어가는데 다음화면에서 500이 뜹니다.


초보입니다.

jsp, 서블릿을 이용해서 dao,vo를 써서 회원가입을 만들고있습니다.

친구랑 메일로 파일자체를 주고받으면서 진행하고있는데

친구컴퓨터에서는 잘 작동이 되는데 그대로 파일 받아도 제 컴퓨터에서는 500이 뜹니다.


소스에서 따로 오류나는 부분은 없고 

회원가입페이지에서 아이디, 비밀번호, 닉네임 3가지만 받아서

회원가입버튼을 누르면 500에러가 떠요.

근데 DB에는 데이터가 잘 들어가있구요.

500에러는 서버문제라는데 어디를 손봐야할지 모르겠어요.

500에러 화면은

Type Exception Report

Message Servlet execution threw an exception

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: Servlet execution threw an exception
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

Root Cause

java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getHttpServletMapping()Ljavax/servlet/http/HttpServletMapping;
	com.baseball.controller.HttpUtil.forward(HttpUtil.java:10)
	com.baseball.controller.JoinController.execute(JoinController.java:35)
	com.baseball.controller.FrontController.service(FrontController.java:35)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

Note The full stack trace of the root cause is available in the server logs.

이렇게 뜨고,

이클립스 콘솔창에는


Thu Jun 14 23:26:57 KST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
6월 14, 2018 11:26:57 오후 org.apache.catalina.core.StandardWrapperValve invoke
심각: Servlet.service() for servlet [front] in context with path [/Baseball] threw exception [Servlet execution threw an exception] with root cause
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getHttpServletMapping()Ljavax/servlet/http/HttpServletMapping;
	at org.apache.catalina.core.ApplicationHttpRequest.setRequest(ApplicationHttpRequest.java:690)
	at org.apache.catalina.core.ApplicationHttpRequest.<init>(ApplicationHttpRequest.java:114)
	at org.apache.catalina.core.ApplicationDispatcher.wrapRequest(ApplicationDispatcher.java:917)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:358)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
	at com.baseball.controller.HttpUtil.forward(HttpUtil.java:10)
	at com.baseball.controller.JoinController.execute(JoinController.java:35)
	at com.baseball.controller.FrontController.service(FrontController.java:35)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:409)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:844)


이렇게 뜹니다.


탐캣 9.0을 쓰고있고 

빌드패스에는 

Apache Tomcatv9.0[Apache Tomcat v9.0]

EAR Libraries

JRE System Library[jdk-9.0.4]

Web App Libraries

가 들어가있어요.


어디에 손을 대야 정상적으로 실행이 될까요?


+소스도 올려보겠습니다.

이건 회원가입컨트롤러입니다.

package com.baseball.controller;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.baseball.service.BaseballService;
import com.baseball.vo.BaseballVO;

public class JoinController implements Controller{
	public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		// Parameter 추출
				String id = request.getParameter("id");
				String passwd = request.getParameter("passwd");
				String nickname = request.getParameter("nickname");
				// 유효성 체크
				if (id.isEmpty() || passwd.isEmpty() || nickname.isEmpty()) {
					request.setAttribute("error", "모든 항목을 빠짐없이 입력해주시기 바랍니다!");
					HttpUtil.forward(request, response, "/join.jsp");
					return;
				}

				// VO객체에 데이타 바인딩
				BaseballVO join_reg = new BaseballVO();
				join_reg.setId(id);
				join_reg.setPasswd(passwd);
				join_reg.setNickname(nickname);

				// Service 객체의 메서드 호출
				BaseballService service = BaseballService.getInstance();
				service.join(join_reg);

				// Output View 페이지로 이동
				request.setAttribute("id", id);
				HttpUtil.forward(request, response, "/result/successJoin.jsp");
			}
		}


이건 dao 소스입니다.


package com.baseball.dao;

import java.sql.*;
import java.util.ArrayList;
import com.baseball.vo.BaseballVO;



public class BaseballDAO {
	private static BaseballDAO dao = new BaseballDAO();
	private BaseballDAO(){}

	public static BaseballDAO getInstance() {
		return dao;
	}

	public Connection connect() {
		Connection conn = null;
		try {
			  Class.forName("com.mysql.jdbc.Driver");
		         String url = "jdbc:mysql://localhost:3306/baseball";
		         String user = "root";
		         String password = "cs1234";
		         conn = DriverManager.getConnection(url, user, password); 
		} catch (Exception ex) {
			System.out.println("conn : " + ex);
		}
		return conn;
	}

	public void join(BaseballVO join_reg) {
		Connection conn = null;
		PreparedStatement pstmt = null;

		try {
			conn = connect();
			pstmt = conn.prepareStatement("insert into member values(?,?,?)");
			pstmt.setString(1, join_reg.getId());
			pstmt.setString(2, join_reg.getPasswd());
			pstmt.setString(3, join_reg.getNickname());
			pstmt.executeUpdate();
		} catch (Exception ex) {
			System.out.println("insert 발생 : " + ex);
		} finally {
			close(conn, pstmt);
		}
	}
//////////////////////////////////////////////////////////////////////////////////////////////////////
	public BaseballVO login(String id) {
		Connection conn = null;
		PreparedStatement pstmt = null;
		ResultSet rs = null;

		BaseballVO join_reg = null;

		try {
			conn = connect();
			pstmt = conn.prepareStatement("select * from member where id=?");
			pstmt.setString(1, id);
			rs = pstmt.executeQuery();
			if (rs.next()) {
				join_reg = new BaseballVO();
				join_reg.setId(rs.getString(1));
				join_reg.setPasswd(rs.getString(2));
				join_reg.setNickname(rs.getString(3));
				
			}

		} catch (Exception ex) {
			System.out.println("select �߻� : " + ex);
		} finally {
			close(conn, pstmt, rs);
		}

		return join_reg;
	}
	
//////////////////////////////////////////////////////////////////////////////////////////////////////	
	public void close(Connection conn, PreparedStatement ps, ResultSet rs) {
		if (rs != null) {
			try {
				rs.close();
			} catch (Exception ex) {
				System.out.println("오류 발생 : " + ex);				
			}
		}
		close(conn, ps);
	} // close

	public void close(Connection conn, PreparedStatement ps) {
		if (ps != null) {
			try {
				ps.close();
			} catch (Exception ex) {
				System.out.println("오류 발생 : " + ex);				
			}
		}

		if (conn != null) {
			try {
				conn.close();
			} catch (Exception ex) {
				System.out.println("오류 발생 : " + ex);				
			}
		}
	} // close

}
1
0
  • 답변 4

  • zumsim
    1k
    2018-06-15 00:03:03

    컨트롤러 소스를 올려주시면 다른분들이 더 빠르게 해결해드릴텐데

    0
  • 리일리
    30
    2018-06-15 00:21:14
    앗 네 소스도 올릴게요
    0
  • 강남길
    2018-06-15 06:54:21 작성 2018-06-15 06:56:56 수정됨

    서버 ssl 사용 설정을 false로 바꾸래요

    server.xml에서 이걸 false로 바꾸면될거같네요


    <Connector SSLEnabled="true"
    0
  • 리일리
    30
    2018-06-15 14:51:47

    탐캣폴더에 conf 폴더 아래 server.xml 에 들어가서

     <!--
        <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
                   maxThreads="150" SSLEnabled="false">
            <SSLHostConfig>
                <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
                             type="RSA" />
            </SSLHostConfig>
        </Connector>
        -->
        <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
             This connector uses the APR/native implementation which always uses
             OpenSSL for TLS.
             Either JSSE or OpenSSL style configuration may be used. OpenSSL style
             configuration is used below.
        -->
        <!--
        <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
                   maxThreads="150" SSLEnabled="false" >
            <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />

    노란색 된 부분이 둘다 true로 되어있어서

    둘다 false로 바꿨는데 그래도 500이뜹니다. ㅜㅜㅜ


    0
  • 로그인을 하시면 답변을 등록할 수 있습니다.