ype Exception Report
Message An exception occurred processing [listaEmpresa.jsp] at line [16]
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: An exception occurred processing [listaEmpresa.jsp] at line [16]
13:
- 14: <% 15: List lista = (List)request.getAttribute("empresas"); 16: for (Empresa empresa : lista) { 17: %> 18:
-
19: <%= empresa.getNome() %>
Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:611) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:500) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327) jakarta.servlet.http.HttpServlet.service(HttpServlet.java:770) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) Root Cause
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "lista" is null org.apache.jsp.listaEmpresa_jsp.jspService(listaEmpresajsp.java:136) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71) jakarta.servlet.http.HttpServlet.service(HttpServlet.java:770) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:467) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327) jakarta.servlet.http.HttpServlet.service(HttpServlet.java:770) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)