I am sending a fix for the SetContentHandler.java file, which removes a "System.out.println" call that dumped the content of a new XMLResource when set with the "setContentAsSAX"call.
 
This is the changed piece:
 
    public void endDocument()
        throws SAXException
    {
     try {
         resource.setContent(newContent.toString());
        }
        catch(XMLDBException e) {
         throw new SAXException (e.getMessage());
        }
        //System.out.println(newContent.toString());
    }
I had to add the try/catch block as well.
 
Thanks,
 
jlerm
----- Original Message -----
From: jcplerm
Sent: Thursday, July 24, 2003 10:48 AM
Subject: Re: java.lang.NoClassDefFoundError: org/xmldb/api/sdk/modules/SetContentHandler (???)

Thanks for confirming the class does exist.
 
But I already had xmldb.jar on my Tomcat common/lib dir, and I actually found SetContentHandler in xmldb-sdk.jar, instead.
 
jlerm
----- Original Message -----
Sent: Wednesday, July 23, 2003 11:00 PM
Subject: RE: java.lang.NoClassDefFoundError: org/xmldb/api/sdk/modules/SetContentHandler (???)

The class "org.xmldb.api.sdk.modules.SetContentHandler" is a part of xmldb api. So make sure that you have xmldb.jar in the classpath.
-----Original Message-----
From: jcplerm [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 12:18 PM
To: xindice-users@xml.apache.org
Subject: java.lang.NoClassDefFoundError: org/xmldb/api/sdk/modules/SetContentHandler (???)

 
I am trying to use the XMLResource.setContentAsSAX() method and I get a stack trace reproduced below.
It complains about a "SetContentHandler" class.
 
Can someone explain how to circumvent this?
 
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:381)
 at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:257)
 at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:181)
 at org.apache.xpath._expression_.executeCharsToContentHandler(_expression_.java:301)
 at org.apache.xalan.templates.ElemValueOf.execute(ElemValueOf.java:319)
 at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2182)
 at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2008)
 at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1171)
 at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3135)
 at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.NoClassDefFoundError: org/xmldb/api/sdk/modules/SetContentHandler
 at org.apache.xindice.client.xmldb.resources.XMLResourceImpl.setContentAsSAX(XMLResourceImpl.java:232)
 at com.xxxx.tests.SAXTest1.getResourceContentHandler(SAXTest1.java:217)
 at com.xxxx.tests.SAXTest1.runTest(SAXTest1.java:337)
 
Thanks,
 
jlerm

Attachment: SetContentHandler.java
Description: Binary data

Reply via email to