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: 43 in the jsp file: /obdc.jsp
Generated servlet error:
C:\Documents and Settings\valmir\.netbeans\5.5\apache-tomcat-5.5.17_base\work\Catalina\localhost\AplicacaoWeb1\org\apache\jsp\obdc_jsp.java:85: cannot find symbol
symbol : variable custo
location: class org.apache.jsp.obdc_jsp
out.print(custo);
^
An error occurred at line: 62 in the jsp file: /obdc.jsp
Generated servlet error:
C:\Documents and Settings\valmir\.netbeans\5.5\apache-tomcat-5.5.17_base\work\Catalina\localhost\AplicacaoWeb1\org\apache\jsp\obdc_jsp.java:106: cannot find symbol
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 43 in the jsp file: /obdc.jsp
Generated servlet error:
C:\Documents and Settings\valmir\.netbeans\5.5\apache-tomcat-5.5.17_base\work\Catalina\localhost\AplicacaoWeb1\org\apache\jsp\obdc_jsp.java:85: cannot find symbol
symbol : variable custo
location: class org.apache.jsp.obdc_jsp
out.print(custo);
^
An error occurred at line: 62 in the jsp file: /obdc.jsp
Generated servlet error:
C:\Documents and Settings\valmir\.netbeans\5.5\apache-tomcat-5.5.17_base\work\Catalina\localhost\AplicacaoWeb1\org\apache\jsp\obdc_jsp.java:106: cannot find symbol
Pergunta
shelter
Galera na boa?
Aqui estou bem o inicio da minha saga para adquirir o tal conhecimento JSP... estou com uma duvida que peço a ajuda de meus amigos.
Quero saber o valor de uma consulta SUM ... tenho uma tabela que possui uma coluna onde quero saber o valor total deste dados.
Segue o código:
<%@ page session="false" %>
<%@ page import="java.sql.*" %>
<%
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("JDBC driver loaded");
}
catch (ClassNotFoundException e) {
System.out.println(e.toString());
}
%>
<HTML>
<HEAD>
<TITLE>OBDC</TITLE>
<style type="text/css">
<!--
.style2 {font-family: Tahoma}
.style3 {font-size: 12px}
.style5 {font-family: Tahoma; font-size: 12px; }
body, td, th {
font-family: Tahoma;
font-size: 12px;
}
.style6 {
font-size: 14px;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></HEAD>
<BODY>
<CENTER>
<h4><BR>
</h4>
<H2 align="left" class="style6">Quantidades:</H2>
<div align="left">
<table width="500" border="0">
<tr>
<th width="65" scope="row"><div align="left">Efetuadas:</div></th>
<td width="85">10.000</td>
<td width="70"><strong>Recebidas:</strong></td>
<td width="84"> <% out.print(custo); %></td>
<td width="174"> </td>
</tr>
</table>
<table width="500" border="0" style="border-collapse: collapse; border-left-width: 1; border-right-width: 1; border-top-style: solid; border-top-width: 0; border-bottom-style: solid; border-bottom-width: 0" bordercolor="#111111" cellpadding="0" cellspacing="0">
<tr>
<th width="70" scope="row" style="border-style:none; border-width:medium; ">Ramal</th>
<td width="187" style="border-style:none; border-width:medium; "><div align="center"><strong>Numero Discado </strong></div></td>
<td width="126" style="border-style:none; border-width:medium; "><div align="center"><strong>Data</strong></div></td>
<td width="99" style="border-style:none; border-width:medium; "><div align="right"><strong>Valor</strong></div></td>
</tr>
</table>
<table width="500" border="0">
<tr>
<th scope="row"><hr></th>
</tr>
</table>
</div>
<TABLE width="500" align="left" style="border-left-width: 0; border-right-width: 0; border-top-width: 0">
<%
int custo = new custo();
String sql = "SELECT SUM (custo) " +
" FROM CRJJ04 " +
"where origem= '1001'" +
"And tipo= 0" ;
try {
Connection con = DriverManager.getConnection("jdbc:odbc:Abril");
Statement s = con.createStatement();
ResultSet rs = s.executeQuery(sql);
while (rs.next())
//int cabelo = custo;
{
%>
<TR>
<TD width="69" style="border-top-style: none; border-top-width: medium"><div align="center">
<% out.print(rs.getString(1)); %>
</div></TD>
<TD width="187" style="border-top-style: none; border-top-width: medium"><div align="center"></div>
<div align="center">
<% out.print(rs.getString(3)); %>
</div></TD>
<TD width="127" style="border-top-style: none; border-top-width: medium"><div align="center">
<% out.print(rs.getString(4)); %>
</div></TD>
<TD width="97" style="border-top-style: none; border-top-width: medium"><div align="right">
<% out.print(rs.getString(10)); %>
</div></TD>
</TR>
<%
}
rs.close();
s.close();
con.close();
}
catch (SQLException e) {
}
catch (Exception e) {
}
%>
</TABLE>
<p> </p>
<p> </p>
<div align="left">
<p> </p>
</div>
<p align="left"> </p>
</CENTER>
</BODY>
</HTML>
Estou recebendo o seguinte erro:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
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: 43 in the jsp file: /obdc.jsp
Generated servlet error:
C:\Documents and Settings\valmir\.netbeans\5.5\apache-tomcat-5.5.17_base\work\Catalina\localhost\AplicacaoWeb1\org\apache\jsp\obdc_jsp.java:85: cannot find symbol
symbol : variable custo
location: class org.apache.jsp.obdc_jsp
out.print(custo);
^
An error occurred at line: 62 in the jsp file: /obdc.jsp
Generated servlet error:
C:\Documents and Settings\valmir\.netbeans\5.5\apache-tomcat-5.5.17_base\work\Catalina\localhost\AplicacaoWeb1\org\apache\jsp\obdc_jsp.java:106: cannot find symbol
symbol : class custo
location: class org.apache.jsp.obdc_jsp
int custo = new custo();
^
2 errors
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 43 in the jsp file: /obdc.jsp
Generated servlet error:
C:\Documents and Settings\valmir\.netbeans\5.5\apache-tomcat-5.5.17_base\work\Catalina\localhost\AplicacaoWeb1\org\apache\jsp\obdc_jsp.java:85: cannot find symbol
symbol : variable custo
location: class org.apache.jsp.obdc_jsp
out.print(custo);
^
An error occurred at line: 62 in the jsp file: /obdc.jsp
Generated servlet error:
C:\Documents and Settings\valmir\.netbeans\5.5\apache-tomcat-5.5.17_base\work\Catalina\localhost\AplicacaoWeb1\org\apache\jsp\obdc_jsp.java:106: cannot find symbol
symbol : class custo
location: class org.apache.jsp.obdc_jsp
int custo = new custo();
^
2 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:249)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.17
Por favor me ajudem...
Vlw galera obrigado
Abraços
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.