You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Chua Eng Huang, Cecil" <AE...@ntu.edu.sg> on 2002/07/15 23:32:30 UTC

Document.importNode not working-works fine in modified JSDK2.1

Hi,
 
APOLOGIES
 
Apologies if this appears in MIME (I hope not), I am using the web version of MS Outlook, have no access to the full client, and thus have no control over the options.
 
SUMMARY
 
I've got a bit of a problem with Jakarta Tomcat 3.2.1/3.3.1
I am running a small XML application that takes the getDocumentElement() of a document class and appends it onto another class.  To do this, I use the importNode() function.  When I test it on my home server, which is a modified version of the JSDK2.1 server (modified in the sense that I have randomly added .jar files as needed), the application works.  When I test it on Tomcat 3.2.1/3.3.1, it doesn't.
 
DETAIL
 
The code in question is as follows:
    Document temp=null;
    if (result==null)
      temp=builder.parse(new InputSource(new StringReader("<result>No records</result>")));
    else
      temp=builder.parse(new InputSource(new StringReader(result)));
    Node temp3=temp.getDocumentElement();
    Node temp4=temp2.importNode(temp3,true);
    root2.appendChild(temp4);
    return temp2;
 
The code is sloppy, because I've been trying to debug it, so I tried various permutations of the same code.  This was the last state of the code.
 
The code bombs on "Node temp4=temp2.importNode(temp3,true);"
it reports the error message:

java.lang.NoSuchMethodError
 at sf_maincontrol.setupXMLSearchEngine(sf_maincontrol.java:109)
 at sf_maincontrol.run(sf_maincontrol.java:57)
 at sf.searchme(sf.java:68)
 at sf.doPost(sf.java:16) ...
 
This is odd, because as can be seen on the earlier lines, it is running various other methods of the document class just fine.
 
Originally, I thought it was because I was using an old version of Tomcat (3.2.1), so I switched to Tomcat 4.0.  Tomcat 4.0 was so completely different (and I couldn't get it to install), so I switched to 3.3.1, which worked.
 
All of my own special jars are in the web-inf/lib directory, etc. etc.
 
I just can't understand why it isn't running importNode, but is running all the other methods of the Document class.
 
Thank you
 
Cecil Chua