java.lang.NullPointerException

AppFuse JIRA | J. Garcia | 5 years ago
  1. 0

    For input forms, when there are field errors, they appear duplicated. Besides, when there are action/field messages and a 404 page to show, a stacktrace is produced when deployed in Tomcat, not in Jetty. {code} java.lang.NullPointerException at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49) at org.apache.jsp.decorators.default_jsp._jspx_meth_s_005fif_005f0(default_jsp.java:663) at org.apache.jsp.decorators.default_jsp._jspService(default_jsp.java:230) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) ... {code} Final proposed version: {code} <% if (request.getAttribute("struts.valueStack") != null) { %> <%-- ActionError Messages - usually set in Actions --%> <c:if test="${not empty actionErrors}"> <div class="error" id="errorMessages"> <s:iterator value="actionErrors"> <img src="<c:url value="/images/iconWarning.gif"/>" alt="<fmt:message key="icon.warning"/>" class="icon" /> <s:property escape="false"/><br /> </s:iterator> </div> </c:if> <%-- FieldError Messages - usually set by validation rules --%> <c:if test="${not empty fieldErrors}"> <div class="error" id="errorMessages"> <s:iterator value="fieldErrors"> <s:iterator value="value"> <img src="<c:url value="/images/iconWarning.gif"/>" alt="<fmt:message key="icon.warning"/>" class="icon" /> <s:property escape="false"/><br /> </s:iterator> </s:iterator> </div> </c:if> <%-- Success Messages --%> <c:if test="${not empty messages}"> <div class="message" id="successMessages"> <c:forEach var="msg" items="${messages}"> <img src="<c:url value="/images/iconInformation.gif"/>" alt="<fmt:message key="icon.information"/>" class="icon" /> <c:out value="${msg}"/><br /> </c:forEach> </div> <c:remove var="messages" scope="session"/> </c:if> <% } else { %> <%-- avoid duplicate messages: --%> <%-- Error Messages (on JSPs, not through Struts --%> <%-- avoid duplicate messages: --%> <c:if test="${not empty errors}"> <div class="error" id="errorMessages"> <c:forEach var="error" items="${errors}"> <img src="<c:url value="/images/iconWarning.gif"/>" alt="<fmt:message key="icon.warning"/>" class="icon" /> <c:out value="${error}"/><br /> </c:forEach> </div> <c:remove var="errors" scope="session"/> </c:if> <% } %> {code}

    AppFuse JIRA | 5 years ago | J. Garcia
    java.lang.NullPointerException
  2. 0

    For input forms, when there are field errors, they appear duplicated. Besides, when there are action/field messages and a 404 page to show, a stacktrace is produced when deployed in Tomcat, not in Jetty. {code} java.lang.NullPointerException at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49) at org.apache.jsp.decorators.default_jsp._jspx_meth_s_005fif_005f0(default_jsp.java:663) at org.apache.jsp.decorators.default_jsp._jspService(default_jsp.java:230) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) ... {code} Final proposed version: {code} <% if (request.getAttribute("struts.valueStack") != null) { %> <%-- ActionError Messages - usually set in Actions --%> <c:if test="${not empty actionErrors}"> <div class="error" id="errorMessages"> <s:iterator value="actionErrors"> <img src="<c:url value="/images/iconWarning.gif"/>" alt="<fmt:message key="icon.warning"/>" class="icon" /> <s:property escape="false"/><br /> </s:iterator> </div> </c:if> <%-- FieldError Messages - usually set by validation rules --%> <c:if test="${not empty fieldErrors}"> <div class="error" id="errorMessages"> <s:iterator value="fieldErrors"> <s:iterator value="value"> <img src="<c:url value="/images/iconWarning.gif"/>" alt="<fmt:message key="icon.warning"/>" class="icon" /> <s:property escape="false"/><br /> </s:iterator> </s:iterator> </div> </c:if> <%-- Success Messages --%> <c:if test="${not empty messages}"> <div class="message" id="successMessages"> <c:forEach var="msg" items="${messages}"> <img src="<c:url value="/images/iconInformation.gif"/>" alt="<fmt:message key="icon.information"/>" class="icon" /> <c:out value="${msg}"/><br /> </c:forEach> </div> <c:remove var="messages" scope="session"/> </c:if> <% } else { %> <%-- avoid duplicate messages: --%> <%-- Error Messages (on JSPs, not through Struts --%> <%-- avoid duplicate messages: --%> <c:if test="${not empty errors}"> <div class="error" id="errorMessages"> <c:forEach var="error" items="${errors}"> <img src="<c:url value="/images/iconWarning.gif"/>" alt="<fmt:message key="icon.warning"/>" class="icon" /> <c:out value="${error}"/><br /> </c:forEach> </div> <c:remove var="errors" scope="session"/> </c:if> <% } %> {code}

    AppFuse JIRA | 5 years ago | J. Garcia
    java.lang.NullPointerException
  3. 0

    Struts2/Tiles internal exception

    Stack Overflow | 3 years ago | Emaborsa
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    when am trying to get pdf i got this error. anyone can help me | Jaspersoft Community

    jaspersoft.com | 1 year ago
    org.apache.jasper.JasperException: java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag()
    2. Struts2
      ComponentTagSupport.doStartTag
      1. org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
      1 frame
    3. org.apache.jsp
      default_jsp._jspService
      1. org.apache.jsp.decorators.default_jsp._jspx_meth_s_005fif_005f0(default_jsp.java:663)
      2. org.apache.jsp.decorators.default_jsp._jspService(default_jsp.java:230)
      2 frames
    4. GWT dev
      HttpJspBase.service
      1. org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      1 frame
    5. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      1 frame
    6. GWT dev
      JspServlet.service
      1. org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
      2. org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
      3. org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
      3 frames
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      1 frame