3 Replies Latest reply on Dec 18, 2007 12:18 PM by Sergey Smirnov

    NEKO java.util.EmptyStackException

    Mike Hanafey Newbie

      I have a strange problem where AJAX updates do not work when org.ajax4jsf.xmlparser.ORDER is set to "NEKO". It works fine with "TIDY" or "NONE". This is a facelets application, and all of the views appear to be valid xhtml.

      The question is, is this a problem with the neko parser, or is there likely something wrong in my view code. I have spend a fair amount of time trying to isolate what is causing the problem, but other than knowing that having a rich:tree nested inside of a node of an outer rich:tree is needed to trigger the problem, I don't understand what is going on.

      I did update from neko 0.9.5 to 1.9.6, but this had no affect.

      Any help will be appreciated.


      The appserver logs show:

      java.util.EmptyStackException
       at java.util.Stack.peek(Stack.java:85)
       at java.util.Stack.pop(Stack.java:67)
       at org.ajax4jsf.xml.serializer.NamespaceMappings.popNamespace(NamespaceMappings.java:224)
       at org.ajax4jsf.xml.serializer.ToStream.endPrefixMapping(ToStream.java:2307)
       at org.apache.xerces.parsers.AbstractSAXParser.endNamespaceMapping(Unknown Source)
       at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
       at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:258)
       at org.cyberneko.html.filters.Purifier.endElement(Purifier.java:320)
       at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:258)
       at org.ajax4jsf.webapp.nekko.HtmlCorrectionFilter.endElement(HtmlCorrectionFilter.java:63)
       at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:258)
       at org.ajax4jsf.webapp.nekko.NekkoParser$ViewStateFilter.endElement(NekkoParser.java:415)
       at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:258)
       at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:376)
       at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1024)
       at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:897)
      


      The a4j:log show the following for the end of the response:

       <div id="ll:seqTree:0:2:0:j_id46:childs" style="display: none;" class="dr-tree-layout-on dr-tree-h-ic-div rich-tree-node-cildren"></div>
       </div>
       </div>
       </div>
       <input type="hidden" id="ll:seqTree:input" name="ll:seqTree:input" value="ll:seqTree:0:j_id66"/>
       <script type="text/javascript"> //<![CDATA[ var Richfaces_Tree_ll_seqTree = new Tree("ll:seqTree", "ll:seqTree:input", "client", { onselect: "", onexpand: "", oncollapse: "" }, function(event) { A4J.AJAX.Submit('_viewRoot','ll',event,{'parameters':{'ll:seqTree:selectedNode':event.selectedNode} ,'actionUrl':'/Tractor/search/leadView.jsf'} ); return false; }, false, true ); Richfaces_Tree_ll_seqTree.drop = function(event,drag){var options = {'parameters':{'ll:seqTree':'ll:seqTree'} ,'actionUrl':'/Tractor/search/leadView.jsf'} ;options.parameters['dropTargetId'] = 'll:seqTree';Object.extend(options.parameters,drag.getParameters());var dzOptions = this.getDropzoneOptions(); if (dzOptions.ondrop) { if (!dzOptions.ondrop.call(this, event)) return; };A4J.AJAX.Submit('_viewRoot','ll',event,options);}; //]]> </script>
       <div id="ll:seqTree:script">
       <script type="text/javascript"></script>
       </div>
      </div>


      (note the absence of the closing body and html tags. In contrast, with NONE or TIDY the end of the server response looks like:

       <div id="ll:seqTree:0:2:0:j_id46:childs" style="display: none;" class="dr-tree-layout-on dr-tree-h-ic-div rich-tree-node-cildren"></div>
       </div>
       </div>
       </div>
       <input type="hidden" id="ll:seqTree:input" name="ll:seqTree:input" value="ll:seqTree:0:j_id66"/>
       <script type="text/javascript">//<![CDATA[ var Richfaces_Tree_ll_seqTree = new Tree("ll:seqTree", "ll:seqTree:input", "client", { onselect: "", onexpand: "", oncollapse: "" }, function(event) { A4J.AJAX.Submit('_viewRoot','ll',event,{'parameters':{'ll:seqTree:selectedNode':event.selectedNode} ,'actionUrl':'/Tractor/search/leadView.jsf'} ); return false; }, false, true ); Richfaces_Tree_ll_seqTree.drop = function(event,drag){var options = {'parameters':{'ll:seqTree':'ll:seqTree'} ,'actionUrl':'/Tractor/search/leadView.jsf'} ;options.parameters['dropTargetId'] = 'll:seqTree';Object.extend(options.parameters,drag.getParameters());var dzOptions = this.getDropzoneOptions(); if (dzOptions.ondrop) { if (!dzOptions.ondrop.call(this, event)) return; };A4J.AJAX.Submit('_viewRoot','ll',event,options);}; //]]> </script>
       <div id="ll:seqTree:script">
       <script type="text/javascript"></script>
       </div>
      </div>
      <meta name="Ajax-Update-Ids" content="ll:cmtTree:j_id39,ll:cmtTree:j_id41,ll:seqTree"/>
      <span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="_id12"/></span>
      <meta id="Ajax-Response" name="Ajax-Response" content="true"/>
      </body>
      </html>