1 Reply Latest reply on Oct 15, 2003 6:46 PM by juha

    Sample application illustrtaing jboss J2EE compliance

    srikanth.d

      Done (in CVS). If you happen to have some spare time, you could merge the 2 parse methods into 1, I think we could easily extract a common method used by the 2 parse() methods...
      Bela


      "jiwils" wrote:
      Your XMLConfigurator changes added a bug, and it makes your changes unlikely to work.

      The try block at line 323 in the parse method that takes an Element as a parameter starts like this:

      try {
       Node root=null;
      
       NodeList roots=root_element.getChildNodes();
       for(int i =0; i < roots.getLength(); i++) {
       root=roots.item(i);
       if(root.getNodeType() != Node.ELEMENT_NODE)
       continue;
       }
      
       String root_name=root.getNodeName();


      Considering that the Element passed is likely the "config" element, this code would not work, and since the root node is always assigned regardless of its node type in the for loop, who knows what node you will end up with.

      I made the following changes in order to get the expected behavior:

      try {
       Node root=root_element;
      
      // NodeList roots=root_element.getChildNodes();
      // for(int i =0; i < roots.getLength(); i++) {
      // root=roots.item(i);
      // if(root.getNodeType() != Node.ELEMENT_NODE)
      // continue;
      // }
      
       String root_name=root.getNodeName();


      Can you commit this change (or something like it) to CVS?