tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alec Cove" <co...@kpe.com>
Subject xml - runtime error
Date Tue, 06 Jun 2000 15:47:36 GMT
Im having a strange runtime error when I attempt to run the below code as a
servlet on tomcat. It works fine when run as an application.

InputSource input = Resolver.createInputSource(new File(filename));
XmlDocument doc = XmlDocument.createXmlDocument(input, false);
doc.getDocumentElement().normalize();

the error is:

error 500
java.lang.NoSuchMethodError: org.w3c.dom.Node: method normalize()V not found


does anyone know why this is happening? the full code is below.
WinNT4
Tomcat3.1
----------------------------------------------------
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.w3c.dom.Document;
import com.sun.xml.parser.Resolver;
import com.sun.xml.tree.XmlDocument;


public class TestServlet extends HttpServlet {

	public void doGet(HttpServletRequest req, HttpServletResponse res)
        	throws ServletException, IOException  {

        String filename = "h:\\desktop\\test.xml";

		try {
			InputSource input = Resolver.createInputSource(new File(filename));
			XmlDocument doc = XmlDocument.createXmlDocument(input, false);
			doc.getDocumentElement().normalize();
		} catch (SAXException e) {
			//
		}
   }
}


Mime
View raw message