Chuster
Chuster

Reputation: 1

Error to refresh jsp many times

I am making a web application using servlets and jsp in netbeans. I made a form that has a select that is filled with data from my mysql database. When I start the project all is well, the select fill and I can select an option, if I update the page data continues to show well but if I update more often, about 5 or more times I get the following error:

Estado HTTP 500 - Ha sucedido una excepción al procesar la página JSP /Depas.jsp en línea 40

type Informe de Excepción

mensaje Ha sucedido una excepción al procesar la página JSP /Depas.jsp en línea 40

descripción El servidor encontró un error interno que hizo que no pudiera rellenar este requerimiento.

excepción

org.apache.jasper.JasperException: Ha sucedido una excepción al procesar la página JSP /Depas.jsp en línea 40

37:                                         <div >
38:                                             <select id="departamento" name="departamento" >
39:                                                 <option value>Seleccione</option>
40:                                                 <%for(int i=0; i<listaDepartamentos.size();i++)
41:                                                 {%>
42: 
43:                                                 <option><%=listaDepartamentos.get(i).getDepartamento()%></option>


Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

causa raíz

java.lang.NullPointerException
    org.apache.jsp.Depas_jsp._jspService(Depas_jsp.java:104)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

nota La traza completa de la causa de este error se encuentra en los archivos de diario de Apache Tomcat/8.0.3.

It's like not obtain the data to fill the select, if I upgrade again shows me the page again without error but if I upgrade again get the error, but update is not fixed and the only way for me to redisplay the page is to give the "clean" option to my project and run it again, but if I update several times it is the same and so on.

Is there any solution for the update many times, as all the pages I see on the Internet, do not show this error? I do not know if it Apache, or is resolved to upload it to a hosting. Because in the future I would like to finish the project and has no errors for upload to the Internet. Please help, thanks. Sorry for my bad english

Upvotes: 0

Views: 582

Answers (1)

Jordi Reina
Jordi Reina

Reputation: 111

It should be a comment but I don't have enough reputation (still):

Check the line 104 of Depas_jsp.java. There you can see where exactly the NullPointerException is happening.

Upvotes: 2

Related Questions