You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Tracy Milburn <th...@yahoo.com> on 2002/02/12 19:00:08 UTC

Question

I've recently switched to the latest version of Xerces
but a couple of things so far are not working that
were working before. I keep getting "No such method"
exceptions on certain things like serializing a
document and calling cloneNode. Here are a couple of
examples, please tell me why they are throwing the
stacktrace:

This code:

   public static final void domSerialize(Document doc,
String outFileName)
   throws SAXException {

        OutputFormat format=new OutputFormat("xml",
"UTF-8", true);
        format.setOmitComments(true);

        try {
           PrintWriter pw=new PrintWriter(new
FileWriter(outFileName));
           XMLSerializer slz=new
XMLSerializer(pw,format);

           slz.serialize(doc);
        }
        catch (IOException iow) {
           throw new SAXException(iow);
        }

        Rexel.getInstance().debug("debug - created
serialize XML file: " + outFileName);
   }

Is throwing this exception:

java.lang.NoSuchMethodError

	at
org.apache.xml.serialize.XMLSerializer.serializeElement(XMLSerializer.java:674)

	at
org.apache.xml.serialize.BaseMarkupSerializer.serializeNode(BaseMarkupSerializer.java:1062)

	at
org.apache.xml.serialize.BaseMarkupSerializer.serializeNode(BaseMarkupSerializer.java:1130)

	at
org.apache.xml.serialize.BaseMarkupSerializer.serialize(BaseMarkupSerializer.java:468)

	at rexel.xml.XMLUtils.domSerialize(XMLUtils.java:110)

	at rexel.xml.XMLUtils.main(XMLUtils.java:138)

This code:

      doc.cloneNode(true);

Is throwing this exception:

java.lang.NoSuchMethodError

	at
org.apache.xerces.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1080)

	at
org.apache.xerces.dom.CoreDocumentImpl.cloneNode(CoreDocumentImpl.java:349)

	at
org.apache.xerces.dom.DocumentImpl.cloneNode(DocumentImpl.java:205)

	at rexel.xml.templates.Ariba.readDoc(Ariba.java:56)

	at rexel.xml.templates.Ariba.main(Ariba.java:65)


Thanks!


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Re: Question

Posted by Tracy Milburn <th...@yahoo.com>.
Thanks Andy. 

I actually figured it out, but it took me well over an
hour. You wouldn't believe what it was.  I didn't
think it was a classpath problem because I only had
Xerces installed, and I didn't even have the JAXP
library from JBuilder attached to my project.  BUT, as
it turns out, I did have the WebLogic 5.1
(weblogicaux.jar) and, loe-and-behold, sure enough it
has an implementation of the Sun parser in it. So, I
dropped that one and added it after the Xerces and I
seem to be working now.  

Take care!

--- Andy Clark <an...@apache.org> wrote:
> Tracy Milburn wrote:
> > I've recently switched to the latest version of
> Xerces
> > but a couple of things so far are not working that
> > were working before. I keep getting "No such
> method"
> > exceptions on certain things like serializing a
> > document and calling cloneNode. Here are a couple
> of
> 
> Classpath problem. Make sure that you don't have
> another (older)
> version of the Xerces parser (or the libraries it
> uses like DOM
> and SAX) on the classpath of your system.
> 
> -- 
> Andy Clark * andyc@apache.org
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> xerces-j-dev-help@xml.apache.org
> 


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Re: Question

Posted by Andy Clark <an...@apache.org>.
Tracy Milburn wrote:
> I've recently switched to the latest version of Xerces
> but a couple of things so far are not working that
> were working before. I keep getting "No such method"
> exceptions on certain things like serializing a
> document and calling cloneNode. Here are a couple of

Classpath problem. Make sure that you don't have another (older)
version of the Xerces parser (or the libraries it uses like DOM
and SAX) on the classpath of your system.

-- 
Andy Clark * andyc@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org