Hi all,...
I still get the exception (see below) even after using a different batik.jar
when I deploy my application to a stand-alone Tomcat server (batik.jar
included in WAR file).
>>> exeption...
java.lang.NoClassDefFoundError: org/w3c/dom/svg/SVGDocument at
org.apache.fop.image.analyser.ImageReaderFactory.Make(ImageReaderFactory.jav
a:45)
... exception <<<
still in jbuilder integrated tomcat everything works fine.
my java servlet source code for the pdf generation is as follows:
/**
* renders an FO inputsource into a PDF file which is rendered
* directly to the response object's OutputStream
*/
public byte[] renderFO(String foFileStr, HttpServletResponse response)
throws ServletException {
try {
InputSource foFile = new InputSource(new FileInputStream(foFileStr));
ByteArrayOutputStream out = new ByteArrayOutputStream();
Driver driver = new Driver(foFile, out);
driver.setRenderer(Driver.RENDER_PDF);
driver.run();
byte[] content = out.toByteArray();
// this is the pdf in memory!
return content;
} catch (Exception ex) {
// throw any error back to upper method...
throw new ServletException(ex);
}
}
i have added the following imports to the class:
import java.util.*;
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.xml.sax.*;
import org.apache.fop.apps.Driver;
import org.apache.fop.apps.Version;
import org.apache.xalan.xslt.*;
the following fop related archives are deployed with the war file besides
other archives:
C:\Programme\Apache Group\Fop-0.20.2\lib\avalon-framework-4.0.jar
C:\Programme\Apache Group\Fop-0.20.2\lib\batik.jar
C:\Programme\Apache Group\Fop-0.20.2\lib\logkit-1.0b4.jar
C:\Programme\Apache Group\Fop-0.20.2\lib\jimi.jar
C:\Programme\Apache Group\Fop-0.20.2\build\fop.jar
xalan and xerces: the versions of jbuilder 5 are used
for any tips... thanks in advance... any help is appreciated!
best regards, Michael
BEGIN:VCARD
VERSION:2.1
N:Schifferdecker;Michael
FN:Schifferdecker, Michael
TEL;CELL;VOICE:+49 178 4581747
ADR;HOME:;;S2,2;Mannheim;;68161
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:S2,2=0D=0AMannheim 68161
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20011119T170929Z
END:VCARD