Title: [Click and type the General title]

 

Hello,

 

I use Xerces in a small JSP project to generate a XML file. After creating my DOM document, I try to save it with this small piece of code:

 

  protected void saveDocument(Document xmldoc, String filename) throws IntranetException

  {

    try

    {

      File tempFile = new File(filename);

 

      // Serialize the document into the file

      FileOutputStream fos = new FileOutputStream(tempFile);

      OutputFormat of = new OutputFormat("XML", "ISO-8859-1", true);

      of.setIndent(1);

      of.setIndenting(true);

      XMLSerializer serializer = new XMLSerializer(fos, of);

      serializer.asDOMSerializer();

      serializer.serialize(xmldoc);

      fos.close();

 

That work fine with old V1.3, and with V2.0 version (XERCES.JAR replaced by XERCESIMPL.JAR and XMLPARSERAPI.JAR). But with Last version (2.4) or previous one (2.3, 2.2, 2.1), I get a exception:

root cause

java.lang.NoClassDefFoundError: org/w3c/dom/traversal/NodeFilter
        at minfin.XmlBean.saveDocument(XmlBean.java:101)
        at minfin.XmlInternet.exportNetp(XmlInternet.java:168)
        at org.apache.jsp.act_0005fexpinternet$jsp._jspService(act_0005fexpinternet$jsp.java:80)

 

 

Any idea?

 

 

 

David

 

Reply via email to