title: Library Problems with Struts 2 Ajax JSON
body: <p>I'm trying to have an Ajax call in my Struts 2 project in Netbeans, and I'm having issues getting it to work that seem to have to do with libraries. First of all, the only combination I've found that works at all is to use the current (2.5.22) JSON plugin with the Struts 2.3 core libraries; if I use the &quot;correct&quot; 2.3 version of the plugin, or if I use the 2.5 Struts libraries all around, I don't get any error messages, but I don't get any data either: none of the fields of the action class get populated. However, I can't get the return data back; instead I get an HTML-formatted 500 message saying &quot;java.lang.NoClassDefFoundError: Could not initialize class org.apache.struts2.json.JSONResult&quot; plus a ton of traceback after that. I can see perfectly well that this class is there in the JSON plugin jar. So my library list at present looks like this:
  <a href="https://i.stack.imgur.com/rhU1S.png" rel="nofollow noreferrer">library list</a></p>
  <p>My struts.xml entry for the action in question is</p>
  <pre><code>        &lt;action name=&quot;updateProductWorkforceAjax&quot; class=&quot;prsm2.display.controller.SingleProductAjax&quot;
              method=&quot;updateProductWorkforceAjax&quot;&gt;
          &lt;interceptor-ref name=&quot;json&quot;&gt;                                                                                                              
              &lt;param name=&quot;enableSMD&quot;&gt;true&lt;/param&gt;                                                                                                                                                                                     
          &lt;/interceptor-ref&gt;                                                                                                                           
          &lt;result type=&quot;json&quot;&gt;
          &lt;/result&gt;                                                                                                  
      &lt;/action&gt;
  </code></pre>
  <p>and I am extending the json-default package.</p>
  <p>The Ajax call looks like this:</p>
  <pre><code>              var arg = {dvList: dvlist,
                  prodId : prodId,
                  orgId : orgId,
                  programYear : programYear,
                  functionalArea : fa};
              
              $.ajax({
                  data: arg,
                  type: 'POST',
                  dataType : 'json',
                  url: 'updateProductWorkforceAjax',
                  success: function(data) {
                      control.log(data);
                  },
                  error:function(result) {
                      var zz = result;
                  }
              })
  </code></pre>
  <p>where all the variables folded into arg are strings. The action class has all the required getters and setters and appears to work fine-- after all if I use the inconsistent libraries, it gets data correctly.</p>
  <p>I've tried using a complete set of libraries for one version, which will not run at all (the server won't even start).</p>
  <p>If someone can tell me what libraries will work together for this, or what I'm doing wrong with the ones I have, I would appreciate it.</p>