>>>>> "KL" == Karl Larsson <[EMAIL PROTECTED]> writes:

KL> I am trying to use the Batik transcoder API as part of a Lotus
KL> Notes 6 Java agent. The code is pretty much the same as the
KL> SaveAsJpeg example in the documentation and it all works fine
KL> until I actually try and transcode the TranscodeInput into the
KL> TranscoderOutput, which gives me the following error:

KL> java.lang.NoSuchMethodError: 
KL>   org.w3c.dom.DOMImplementation: method 
KL> 
createDocument(Ljava/lang/String;Ljava/lang/String;Lorg/w3c/dom/DocumentType;)Lorg/w3c/dom/Document;

    No such method exceptions are almost always caused by picking up a
DOM implementation that does not support styling.  You need to make
sure that the DOM interface included with Batik is earlier on the
class path for the agent than what ever DOM Lotus Notes is including
(I don't know how you would do that or even if it is possible in
Notes).

KL> not found at
KL> org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown
KL> Source) at
KL> org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown
KL> Source) at
KL> org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown
KL> Source) at
KL> org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
KL> Source) at SaveAsJPEG.createJPEG(SaveAsJPEG.java:37) at
KL> JavaAgent.NotesMain(JavaAgent.java:32) at
KL> lotus.domino.AgentBase.runNotes(Unknown Source) at
KL> lotus.domino.NotesThread.run(NotesThread.java:208)

KL> Although Lotus Notes natively uses IBM's XML4j.jar, adding
KL> XMLResourceDescriptor.getXMLParserClassName() to the code returns
KL> the following:

KL> org.apache.crimson.parser.XMLReaderImpl

KL> If I remove XML4j.jar from my Notes installation, the agent fails
KL> on the same line but for a different reason:

KL> java.io.IOException: java.lang.NullPointerException at
KL> org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown
KL> Source) at

    It's a little hard to tell without line numbers but I think this
is most likely caused by the call to
XMLReaderFactor.createXMLReader(parserClassName) returning Null (i.e.
org.apache.crimson.parser.XMLReaderImpl isn't available).

    You can build a debug version by putting adding a build.properties
file in the root of the batik source distribution with the line
'debug=on' in it.

KL> org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown
KL> Source) at
KL> org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown
KL> Source) at
KL> org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
KL> Source) at SaveAsJPEG.createJPEG(SaveAsJPEG.java:37) at
KL> JavaAgent.NotesMain(JavaAgent.java:32) at
KL> lotus.domino.AgentBase.runNotes(Unknown Source) at
KL> lotus.domino.NotesThread.run(NotesThread.java:208)
KL> org.apache.batik.transcoder.TranscoderException: null Enclosed
KL> Exception: java.lang.NullPointerException at
KL> org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
KL> Source) at SaveAsJPEG.createJPEG(SaveAsJPEG.java:37) at
KL> JavaAgent.NotesMain(JavaAgent.java:32) at
KL> lotus.domino.AgentBase.runNotes(Unknown Source) at
KL> lotus.domino.NotesThread.run(NotesThread.java:208)

KL> Again, XMLResourceDescriptor.getXMLParserClassName() returns the
KL> following:

KL> org.apache.crimson.parser.XMLReaderImpl

KL> Has anyone got any ideas? If it helps, Lotus Notes creates a new
KL> classpath each time an agent is run, in the following order:

KL> 1) Any classes or archives added to Lotus Notes ini file (I have
KL> none) 2) Any default classes or archive files Notes uses (this is
KL> where XML4j.jar gets picked up from) 3) And classes or archive
KL> files attached to the agent itself (this is where all the Batik
KL> files are)

    Yah, so you need to get the Batik DOM interfaces up into 1 (it is
in batik-ext.jar). Also in #3 do you have all the stuff in lib (like
crimson-parser.jar)?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to