eyuntaek
79
2018-04-15 23:53:13
3
1051

http 500 에러 살려주세요 ㅠㅠ


HTTP Status 500 – Internal Server Error


Type Exception Report

Message Unable to compile class for JSP:

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

Exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [301] in the generated java file: [C:\Program Files\Apache Software Foundation\Tomcat 9.0\work\Catalina\localhost\LIBRARY\org\apache\jsp\current_005fall_jsp.java]
Syntax error, insert "}" to complete Block

An error occurred at line: [318] in the generated java file: [C:\Program Files\Apache Software Foundation\Tomcat 9.0\work\Catalina\localhost\LIBRARY\org\apache\jsp\current_005fall_jsp.java]
Syntax error on token "}", delete this token

An error occurred at line: [319] in the generated java file: [C:\Program Files\Apache Software Foundation\Tomcat 9.0\work\Catalina\localhost\LIBRARY\org\apache\jsp\current_005fall_jsp.java]
Syntax error, insert "}" to complete ClassBody

Stacktrace:
	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:213)
	org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:461)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:392)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:362)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:346)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	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.


추가한거라곤 jsp에서 테이블 추가 했는데 저에러가 납니다 java는건든거 하나두없구요

jsp구문은

<%-- 

    Document   : current_all

    Created on : 2018. 4. 2, 오전 3:14:22

    Author     : dbsxo

--%>


<%@page import="sql.Dao"%>

<%@page import="sql.Bean"%>

<%@page import="java.util.Iterator"%>

<%@page import="java.util.List"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

    <title>LIBRARY</title>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">

    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">

    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

    <style>

        .w3-sidebar a {font-family: "Roboto", sans-serif}

        body,h1,h2,h3,h4,h5,h6,.w3-wide {font-family: "Montserrat", sans-serif;}

    </style>

    <body class="w3-content" style="max-width:1200px">


        <!-- Sidebar/menu -->

        <nav class="w3-sidebar w3-bar-block w3-white w3-collapse w3-top" style="z-index:3;width:250px" id="mySidebar">

            <div class="w3-container w3-display-container w3-padding-16">

                <i onclick="w3_close()" class="fa fa-remove w3-hide-large w3-button w3-display-topright"></i>

                <a href="index.html" class="w3-button w3-black"><b>석장 도서관</b></a>

            </div>

            <div class="w3-padding-64 w3-large w3-text-grey" style="font-weight:bold">

                <a href="index.html" class="w3-bar-item w3-button">도서관</a>

                <a href="recommend.jsp" class="w3-bar-item w3-button">추천 도서</a>

                <a onclick="myAccFunc()" href="javascript:void(0)" class="w3-button w3-block w3-left-align" id="myBtn1">

                    도서 대출 <i class="fa fa-caret-down"></i>

                </a>

                <div id="도서대출" class="w3-bar-block w3-hide w3-padding-large w3-medium">

                    <a href="rent_all.jsp" class="w3-bar-item w3-button"></i>전체</a>

                    <a href="rent_economy.jsp" class="w3-bar-item w3-button">경제/경영</a>

                    <a href="rent_novel.jsp" class="w3-bar-item w3-button">소설</a>

                    <a href="rent_poetry.jsp" class="w3-bar-item w3-button">시/에세이</a>

                    <a href="rent_self.jsp" class="w3-bar-item w3-button">자기계발</a>

                    <a href="rent_employment.jsp" class="w3-bar-item w3-button">취업/수험서</a>

                </div>

                <a onclick="myAccFunc1()" href="javascript:void(0)" class="w3-button w3-block w3-white w3-left-align" id="myBtn2">

                    도서 현황 <i class="fa fa-caret-down"></i>

                </a>

                <div id="도서현황" class="w3-bar-block w3-hide w3-padding-large w3-medium">

                    <a href="current_all.jsp" class="w3-bar-item w3-button w3-light-grey"><i class="fa fa-caret-right w3-margin-right"></i>전체</a>

                    <a href="current_economy.jsp" class="w3-bar-item w3-button">경제/경영</a>

                    <a href="current_novel.jsp" class="w3-bar-item w3-button">소설</a>

                    <a href="current_poetry.jsp" class="w3-bar-item w3-button">시/에세이</a>

                    <a href="current_self.jsp" class="w3-bar-item w3-button">자기계발</a>

                    <a href="current_employment.jsp" class="w3-bar-item w3-button">취업/수험서</a>

                </div>


            </div>


        </nav>


        <!-- Top menu on small screens -->

        <header class="w3-bar w3-top w3-hide-large w3-black w3-xlarge">

            <div class="w3-bar-item w3-padding-24 w3-wide">LOGO</div>

            <a href="javascript:void(0)" class="w3-bar-item w3-button w3-padding-24 w3-right" onclick="w3_open()"><i class="fa fa-bars"></i></a>

        </header>


        <!-- Overlay effect when opening sidebar on small screens -->

        <div class="w3-overlay w3-hide-large" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div>


        <!-- !PAGE CONTENT! -->

        <div class="w3-main" style="margin-left:250px;font-weight:bold ">


            <!-- Push down content on small screens -->

            <div class="w3-hide-large" style="margin-top:83px"></div>


            <!-- Top header -->

            <header class="w3-container w3-xlarge">

                <p class="w3-left ">도서 현황 / 전체</p>

                <p class="w3-right">

                    <i class="fa fa-shopping-cart w3-margin-right"></i>

                    <i class="fa fa-search"></i>

                </p>

            </header>


        </div>

        <table align="center">

            <tr>

                <td colspan="8" align="center" height="50" class="font-color">

                </td>

            </tr>

            <tr align="center" height="35">

                <td width = "150" >대출 유무</td>

                <td width = "60">도서명</td>

                <td width = "300">글쓴이</td>

                <td width = "130">장르</td>

                <td width = "80">출판사</td>

                <td width = "230">정보원</td>

                <td width = "250">출판년도</td>

                <td width = "80">가격</td>

                <td width = "230">대출 기한</td>

            </tr>

            <%

                Dao ldao = new Dao();

                List r = ldao.all();

                Iterator p = r.iterator();

                Bean lbean = null;

                while (p.hasNext()) {

                    lbean = (Bean) p.next();

            %> 

            <tr align="center">

                <td><% out.println(lbean.getRent());%></td>

                <td><% out.println(lbean.getBook_name());%></td>

                <td style="text-align: left"><% out.println(lbean.getWriter());%></td>

                <td><% out.println(lbean.getArea());%></td>

                <td><% out.println(lbean.getCompany());%></td>

                <td style="text-align: left"><% out.println(lbean.getInformaiton());%></td>

                <td style="text-align: left"><% out.println(lbean.getYear());%></td>

                <td style="text-align: left"><% out.println(lbean.getPrice());%></td>

                <td style="text-align: left"><% out.println(lbean.getRentdate());%></td>

            </tr> 

        </table>

        <script>

        // Accordion 

            function myAccFunc() {

                var x = document.getElementById("도서대출");

                if (x.className.indexOf("w3-show") == -1) {

                    x.className += " w3-show";

                } else {

                    x.className = x.className.replace(" w3-show", "");

                }

            }

            function myAccFunc1() {

                var x = document.getElementById("도서현황");

                if (x.className.indexOf("w3-show") == -1) {

                    x.className += " w3-show";

                } else {

                    x.className = x.className.replace(" w3-show", "");

                }

            }


        // Click on the "Jeans" link on page load to open the accordion for demo purposes

            document.getElementById("myBtn2").click(); //카테고리 자동 오픈 기능



        // Script to open and close sidebar

            function w3_open() {

                document.getElementById("mySidebar").style.display = "block";

                document.getElementById("myOverlay").style.display = "block";

            }


            function w3_close() {

                document.getElementById("mySidebar").style.display = "none";

                document.getElementById("myOverlay").style.display = "none";

            }


        </script>


    </body>

</html>

굵게한부분을 추가하였습니다 . 살려주세요 ㅠ


0
  • 답변 3

  • sspkos
    139
    2018-04-16 00:03:00

    일단 아래

    {} 확인해 보세요!!

    -----------------------

                    while (p.hasNext()) {

                        lbean = (Bean) p.next();

                %>





  • eyuntaek
    79
    2018-04-16 00:05:26

    감사합니다 ; 이런 단순한 ,,,,

  • 다시시작
    659
    2018-04-16 09:46:25

    학생이라고 생각하고 조언드리자면

    stacktrace만 유심히 보시면 답이 있는 경우가 많습니다.

    이 에러는 아래 한라인으로 답을 찾으셔야 해요.


    An error occurred at line: [319] in the generated java file: [C:\Program Files\Apache Software Foundation\Tomcat 9.0\work\Catalina\localhost\LIBRARY\org\apache\jsp\current_005fall_jsp.java]
    Syntax error, insert "}" to complete ClassBody
    

    at line [319] 

    generated java file : ~

    insert "}"

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