Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5436

Select tag NOT working when using list of org.apache.commons.beanutils.LazyDynaBean

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 6.4.0
    • 6.6.0
    • None
    • None

    Description

      Some jsp file using to get a list from DB:

      <beanList:getList storeProcName="getAllParPeriods" valueType="org.apache.commons.beanutils.LazyDynaBean" listPageName="parPeriods" poolKey="SQLDB" />
      
      <s:form theme="simple" id="EditPAREmpID" name="EditPAREmp.action" action="EditPAR" target="_blank" method="post">
              
               <div class="form-group pr-2  ">
                      <label for="periodid" class="title"> PAR Period:</label>
                      <div class="form-group font-weight-bold">
                          <label for="periodid">Select Par Period</label>
                          <s:select list="#request.parPeriods" name="periodid" listKey="map.periodid" listValue="map.fullparperiod" cssClass="form-control parselect" />
                                              
                      </div> 
                      
                  </div>
              
              </s:form>
      

      Works with struts2-core-6.1.1.jar does NOT work with struts2-core-6.4.0.jar

      2024-06-28 12:22:07 | ERROR | [ajp-nio-127.0.0.1-8011-exec-10] ? (:) | Could not open template
      java.lang.NullPointerException: Cannot invoke "com.opensymphony.xwork2.ActionInvocation.getProxy()" because "invocation" is null
          at org.apache.struts2.components.Component.getNamespace(Component.java:448) ~[struts2-core-6.4.0.jar:6.4.0]
          at org.apache.struts2.components.Component.determineNamespace(Component.java:433) ~[struts2-core-6.4.0.jar:6.4.0]
          at org.apache.struts2.components.ServletUrlRenderer.renderFormUrl(ServletUrlRenderer.java:140) ~[struts2-core-6.4.0.jar:6.4.0]
          at org.apache.struts2.components.Form.populateComponentHtmlId(Form.java:232) ~[struts2-core-6.4.0.jar:6.4.0]
          at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:796) ~[struts2-core-6.4.0.jar:6.4.0]
          at org.apache.struts2.components.ClosingUIBean.start(ClosingUIBean.java:53) ~[struts2-core-6.4.0.jar:6.4.0]
          at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:51) ~[struts2-core-6.4.0.jar:6.4.0]
          at org.apache.jsp.epar.locatePAR_jsp._jspx_meth_s_005fform_005f0(locatePAR_jsp.java:317) ~[?:?]
          at org.apache.jsp.epar.locatePAR_jsp._jspService(locatePAR_jsp.java:202) ~[?:?]
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) ~[jasper.jar:9.0.67]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) ~[servlet-api.jar:4.0.FR]
          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:466) ~[jasper.jar:9.0.67]
      
      org.apache.jasper.JasperException: An exception occurred processing [/epar/locatePAR.jsp] at line [65]
      
      62:                 <div class="form-group font-weight-bold">
      63:                     <label for="periodid">Select Par Period</label>==${parPeriods[0].map.periodid } =${parPeriodsx}
      64:                     <s:select list="#request.parPeriods" name="periodid" listKey="map.periodid" listValue="map.fullparperiod" cssClass="form-control parselect" />
      65:                     
      66:                     
      67:                 </div> 
      68:                 
      
      Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.add(Object)" because "tags" is null
          at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:804) ~[struts2-core-6.4.0.jar:6.4.0]
          at org.apache.struts2.components.UIBean.end(UIBean.java:550) ~[struts2-core-6.4.0.jar:6.4.0]
          at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:38) ~[struts2-core-6.4.0.jar:6.4.0]
          at org.apache.jsp.epar.locatePAR_jsp._jspx_meth_s_005fselect_005f0(locatePAR_jsp.java:388) ~[?:?]
          at org.apache.jsp.epar.locatePAR_jsp._jspx_meth_s_005fform_005f0(locatePAR_jsp.java:338) ~[?:?]
          at org.apache.jsp.epar.locatePAR_jsp._jspService(locatePAR_jsp.java:202) ~[?:?]
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) ~[jasper.jar:9.0.67]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) ~[servlet-api.jar:4.0.FR]
      

      I have other pages where I get no errors but generates an empty <select/>

      <select name="periodid" id="formID" class="form-control " >
          <option value=""></option>
          <option value=""></option>
        </select>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            ajant Javier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: