Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/10/2012, 15:17
EduardoLeon
 
Fecha de Ingreso: agosto-2012
Mensajes: 10
Antigüedad: 11 años, 8 meses
Puntos: 0
error HTTP Status 500

Hola !

Bueno, desearia que me ayudaran con un tema, es un problema de una pagina web en JSP.

Cuando quiero correrla en mi servidor, me muestra un error:

Cita:
HTTP Status 500 -

type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.awt.HeadlessException
root cause

java.awt.HeadlessException
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.2.2 logs.
el codigo de mi pagina es :

Código:
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@page import="DATA.*"%>
<%@page import="BEANS.*"%>
<%@page import="java.util.ArrayList"%>
<!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" />
<title>Listado</title>
</head>
<script language="javascript"> 
  //Funcion que deshabilita todos las cajas de texto  
  function deshabilitar(){
      //capturamos la cantidad de checkBox
      var p=document.form1.chk.length;
      for(x=0;x<p;x++){          
          document.form1.txtcantidad[x].disabled=true;
          document.form1.txtcantidad[x].value="";
      }      
  }
  //Funcion que habilita la caja de texto seleccionado
  function Habilitar(pos){
      if(document.form1.chk[pos].checked==true){
          document.form1.txtcantidad[pos].disabled=false;
          document.form1.txtcantidad[pos].value="1";
          document.form1.txtcantidad[pos].focus();
      }else{
          document.form1.txtcantidad[pos].disabled=true;
          document.form1.txtcantidad[pos].value="";
      }      
  }
  //Funcion que nos manda a la pagina Carrito.jsp
  function ir_Pagina(){
      window.location="Carrito.jsp";
  }
    
</script>
    <body onload="deshabilitar()">
<form id="form1" name="form1" method="post" action="">
  <table width="355" border="0" align="center">
    <tr>
      <td align="center">Listado de Productos</td>
    </tr>
    <tr>
     <%
     ArrayList<BeansProducto> lista1=new ArrayList();
     DataProducto objdata=new DataProducto();
     lista1=objdata.lista_Producto();
     int contador=0,a=0; 
     for(BeansProducto p:lista1){ 
     %>   
      <td><table width="335" height="111" border="3">
        <tr>
          <td width="100" rowspan="4"><img src="Imagenes/<%=p.getCod()%>.jpg" alt="" width="94" height="113" /></td>
          <td width="92">Descripcion</td>
          <td width="117"><%=p.getNom()%></td>
        </tr>
        <tr>
          <td>Precio</td>
          <td>S/. <%=p.getPre()%></td>
        </tr>        
        <tr>
            <td height="26"><input type="checkbox" name="chk" onclick="Habilitar(<%=a%>)" value="<%=p.getCod()%>,<%=p.getNom()%>,<%=p.getPre()%>"/>
            <label for="chk">Cantidad</label></td>
          <td><label for="txtcantidad"></label>
            <input name="txtcantidad" type="text" id="txtcantidad" size="10" maxlength="3" /></td>
        </tr>
      </table></td>
      <%
      contador+=1;
      a++;
      if(contador==3){
       out.print("<tr>");
       contador=0;         
      }      
     }
     %>
    </tr>
  </table>
  <table width="200" border="0" align="center">
    <tr>
      <td align="center"><input type="submit" name="btncomprar"  value="Comprar" /></td>
      <td align="center"><input type="button" name="btnver" value="Ver Carrito"  onclick="ir_Pagina()"/></td>
    </tr>
  </table>
  <p>&nbsp;</p>
</form>
    <%
    //Vamos a PReguntar por los CheckBox Seleccionados
    if(request.getParameter("chk")!=null){
        //capturando los valores del CheckBox (codigo,nombre,precio)
       String valores[]=request.getParameterValues("chk");
       //capturando los valores de los TextBox
       String cantidad[]=request.getParameterValues("txtcantidad");
       for(int x=0;x<valores.length;x++){
           Canasta c=new Canasta();
           String datos[]=valores[x].split(",");
           c.setCod(datos[0]);
           c.setNom(datos[1]);
           c.setPre(Double.parseDouble(datos[2]));
           c.setCant(Integer.parseInt(cantidad[x]));
           c.setTotal(c.getPre()*c.getCant());
           //Vamos agregar al ArrayList
          c.Agregar_carrito(c);     
                     
       }
       Canasta v=new Canasta();
       out.print("<br><center>Cantidad de Productos "+
                  v.listado_carrito().size()+"</center>  ");          
    }
    %>
Djava.awt.headless=true
    </body>
</html>
:/ En que estoy fallando :S