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: [14] in the generated java file: [C:\Users\Meu Computador\workspace\JavaWeb\apache-tomcat-10.0.27\work\Catalina\localhost\easyjava\org\apache\jsp\PokerBankWeb\web\inserirTeste_jsp.java]
Only a type can be imported. DAO.TesteDAO resolves to a package
An error occurred at line: [16] in the generated java file: [C:\Users\Meu Computador\workspace\JavaWeb\apache-tomcat-10.0.27\work\Catalina\localhost\easyjava\org\apache\jsp\PokerBankWeb\web\inserirTeste_jsp.java]
Only a type can be imported. DTO.testeDTO resolves to a package
An error occurred at line: [16] in the jsp file: [/PokerBankWeb/web/inserirTeste.jsp]
testeDTO cannot be resolved to a type
13:
14: <%
15: try {
16: testeDTO objtestedto = new testeDTO();
17: objtestedto.setNome(request.getParameter(“nome_html”));
18: objtestedto.setTipo(request.getParameter(“tipo_html”));
19: objtestedto.setQuantidade(request.getIntHeader(“quantidade_html”));
An error occurred at line: [16] in the jsp file: [/PokerBankWeb/web/inserirTeste.jsp]
testeDTO cannot be resolved to a type
13:
14: <%
15: try {
16: testeDTO objtestedto = new testeDTO();
17: objtestedto.setNome(request.getParameter(“nome_html”));
18: objtestedto.setTipo(request.getParameter(“tipo_html”));
19: objtestedto.setQuantidade(request.getIntHeader(“quantidade_html”));
An error occurred at line: [21] in the jsp file: [/PokerBankWeb/web/inserirTeste.jsp]
TesteDAO cannot be resolved to a type
18: objtestedto.setTipo(request.getParameter(“tipo_html”));
19: objtestedto.setQuantidade(request.getIntHeader(“quantidade_html”));
20:
21: TesteDAO objtestedao = new TesteDAO();
22: objtestedao.CadastrarTeste(objtestedto);
23:
24: } catch (Exception erro) {
An error occurred at line: [21] in the jsp file: [/PokerBankWeb/web/inserirTeste.jsp]
TesteDAO cannot be resolved to a type
18: objtestedto.setTipo(request.getParameter(“tipo_html”));
19: objtestedto.setQuantidade(request.getIntHeader(“quantidade_html”));
20:
21: TesteDAO objtestedao = new TesteDAO();
22: objtestedao.CadastrarTeste(objtestedto);
23:
24: } catch (Exception erro) {
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:213)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:520)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:367)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:792)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Note A pilha de erros completa da causa principal está disponível nos logs do servidor.