HTTP状态500 - 无法为JSP编译类:嵌入式tomcat 8.0.32

时间:2017-06-20 04:39:42

标签: jsp tomcat embedded

我试图通过嵌入式Tomcat 8.0.32服务器运行我的Web应用程序,启动时没有任何错误。但是当我尝试在浏览器中访问该页面时,我收到了此错误。

我在我的网络应用程序的lib文件夹中有以下jar。

ecj-4.5.1.jar,jasper-jdt.jar,jsp-api.jar,jasper-el.jar,jasper.jar,servlet-api.jar,annotations-api.jar

消息

Unable to compile class for JSP:

description The server encountered an internal error that prevented it from fulfilling this request.

exception

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

An error occurred at line: [1] in the generated java file: [D:\Development\webproject\tmp\work\Tomcat\localhost\CoderWeb\org\apache\jsp\pages\hidden_jsp.java]
The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files

An error occurred at line: [29] in the generated java file: [D:\Development\webproject\tmp\work\Tomcat\localhost\CoderWeb\org\apache\jsp\pages\hidden_jsp.java]
Type mismatch: cannot convert from HashSet<?> to Set<String>

An error occurred at line: [29] in the generated java file: [D:\Development\webproject\tmp\work\Tomcat\localhost\CoderWeb\org\apache\jsp\pages\hidden_jsp.java]
Cannot instantiate the type HashSet<?>

An error occurred at line: [29] in the generated java file: [D:\Development\webproject\tmp\work\Tomcat\localhost\CoderWeb\org\apache\jsp\pages\hidden_jsp.java]
Syntax error on token "<", ? expected after this token

Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:449)

Hidden.jsp

<%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />


</head>
<body>

    <iframe id="myFrame" style="display: none;"></iframe>


    <script type="text/javascript">

        document.getElementById("myFrame").addEventListener("load", callAction());

        function callAction() {
            window.location.href = "logoff.action";
        }


    </script>

</body>
</html>

0 个答案:

没有答案