From: Jeremias M. <de...@je...> - 2012-08-14 06:44:29
|
Tomcat's common/lib directory is not likely to properly replace the default JAXP XML parser. That's why I wrote common/endorsed. The XML parser needs to go into the boot classpath. http://xerces.apache.org/xerces2-j/faq-general.html#faq-4 http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html I don't know how Barcode4J is integrated into JasperReports. At any rate, normally, you don't need JDOM or Saxon. Apparently, Batik is used because they let Barcode4J generate barcodes as SVG graphics and then they render those instead of a more direct approach to paint barcodes (without Batik). In the end, I think you're in the wrong forum here with this problem. As I said, it doesn't look like a Barcode4J problem at all looking at the stacktrace. Jeremias Maerki On 14.08.2012 03:18:02 Steve Lopez wrote: > Jeremias, > > Thank you for the tips. Regretfully it still isn't working. I removed the xercesImpl and xml-apis jars from the webapp WEB-INF/lib folder and put them into Tomcat common lib folder (version 2.9.0 of xercesImpl). > > Also confirmed latest versions of Avalon-framework, jdon, saxon, xalan & serializer. (I'm assuming I don't need servlet-api since that is built into Tomcat and commons-cli since I am not using any command line functionality) > > Just for own sanity I tried using the Barbecue library and it seems to work ok (fewer dependencies). Of course it doesn't support DataMatrix so eventually I'd like to get this working. Any additional tips appreciated. > Thanks, > Steve > > -----Original Message----- > From: Jeremias Maerki [mailto:de...@je...] > Sent: Monday, August 13, 2012 4:59 AM > To: bar...@li... > Subject: Re: [Barcode4j-users] problem with deployment and dependenices... > > Hi Steve, > judging from the stack trace, this is no Barcode4J issue. Involved here are JasperReports, Batik and Xerces. "Old version of xercesImpl.jar" > sounds suboptimal to begin with. I'd place xml-apis*.jar and a current Xerces in Tomcat's common/endorsed directory so it replaces the JVM-bundled XML parser. At any rate, this looks like there is a problem loading an XML parser. It's far from a problem with Barcode4J. Good luck. > > > Jeremias Maerki > > > On 12.08.2012 21:56:34 Steve Lopez wrote: > > I am attempting to use barcode4j with an iText report created in iReport. It works fine within preview mode of iReport but when I attempt to generate a PDF via a servlet in Tomcat I get the following error: > > > > My guess is that I am missing a library. I've included barcode4j.jar and a number of batik libraries (bridge, css, dom, svg-deom,svggen, & util). and have xml-apis-1.3.04.jar along with an old version of xercesImpl.jar. Not sure what else I need to include. > > > > Any help is greatly appreciated. > > > > 2012-08-12 12:20:32,553 [http-bio-80-exec-1] ERROR > > org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[ReportServlet]- Servlet.service() for servlet [ReportServlet] in context with path [] threw exception [Filtered request failed.] with root cause java.lang.NullPointerException > > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:247) > > at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1593) > > at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523) > > at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:49) > > at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:187) > > at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:180) > > at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source) > > 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.createSVGDocument(Unknown Source) > > at net.sf.jasperreports.renderers.BatikRenderer.ensureSvg(BatikRenderer.java:181) > > at net.sf.jasperreports.renderers.BatikRenderer.getDimension(BatikRenderer.java:142) > > at net.sf.jasperreports.engine.export.JRPdfExporter.exportImage(JRPdfExporter.java:1364) > > at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:787) > > at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:751) > > at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:665) > > at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:367) > > at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(JasperExportManager.java:163) > > at > > net.sf.jasperreports.engine.JasperRunManager.runReportToPdfStream(Jasp > > erRunManager.java:372) > > > |