Hi,

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

java.lang.NoSuchMethodError: org.w3c.dom.DOMImplementation: method
createDocument(Ljava/lang/String;Ljava/lang/String;Lorg/w3c/dom/DocumentType;)Lorg/w3c/dom/Document;
 not found
      at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
      at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown Source)
      at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown Source)
      at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
      at SaveAsJPEG.createJPEG(SaveAsJPEG.java:37)
      at JavaAgent.NotesMain(JavaAgent.java:32)
      at lotus.domino.AgentBase.runNotes(Unknown Source)
      at lotus.domino.NotesThread.run(NotesThread.java:208)

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

org.apache.crimson.parser.XMLReaderImpl

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

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

Again, XMLResourceDescriptor.getXMLParserClassName() returns the following:

org.apache.crimson.parser.XMLReaderImpl

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

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

Thanks,

Karl




This email and any files transmitted with it are confidential and intended solely for 
the use of individuals or entity to whom they are addressed.

If you have received this email in error, please notify The Salvation Army 
International Headquarters Helpdesk on +44 (0) 20 7398 5466 or the originator of the 
message.

Any views expressed in this message are those of the individual sender, except where 
the sender specifies and with the authority, states them to be the views of The 
Salvation Army International Trustee Company.

[v3.5.1]

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

Reply via email to