Hi Andy Sorry for the long delay getting to your problem; been having connection problems while travelling and my inbox has been backing up more than usual.
This sounds like a classpath problem. If ever you get a NoSuchMethodError when working with DOM its usually that you've got an old version of the DOM level 1 interfaces on your classpath somewhere. DOM Level 1 is a subset of DOM Level 2 but they use the same class names - which is a big shame and causes countless NoSuchMethodError problems which are not immediately obvious. dom4j assumes DOM Level 2 (which supports namespaces) so if you have a DOM level 1 interfaces on your classpath then you can get NoSuchMethodErrors as DOM level 2 introduces new methods. Maybe an old jar is lying around there somewhere, which wasn't when you ran it in your servlet engine... James ----- Original Message ----- From: "A Yang" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 21, 2002 9:04 PM Subject: [dom4j-user] DOMWriter Exception > Hi, > > I have been using the following code to merge two > documents together: > > DOMSource domsrc = null; > DOMWriter domWriter = new DOMWriter(); > domsrc = new DOMSource(domWriter.write(doc)); // > jaxp > msg.getSOAPPart().setContent(domsrc); > > which worked until I tried to refactor it into a > helper class. Now, I get the following exception on > the domWriter.write(doc) call: > > java.lang.NoSuchMethodError: org.w3c.dom.Document: > method > createElementNS(Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element; > not found > at > org.dom4j.io.DOMWriter.appendDOMTree(DOMWriter.java:186) > at > org.dom4j.io.DOMWriter.appendDOMTree(DOMWriter.java:154) > at org.dom4j.io.DOMWriter.write(DOMWriter.java:126) > > Any ideas what's happening? It worked when I had the > fragment in a servlet. > > Thanks, > Andy > > ______________________________________________________________________ > Web-hosting solutions for home and business! http://website.yahoo.ca > > _______________________________________________ > dom4j-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/dom4j-user _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user
