From: siva k. p. <siv...@gm...> - 2015-12-13 16:21:00
|
Hi Team, In one of requirements I need to design the form using XSLT 1.0 and generate the pdf using Apache FOP. For the barcode I am using Barcode4J. 1. Below is the classpath I am setting set classpath=.;D:/libs/barcode4j-2.1.jar;D:/libs/barcode4j-fop-ext-2.0.jar;D:/libs/avalon-framework-4_2_0.jar;D:/libs/commons-cli-1.0.jar;D:/fop-2.0-bin/fop-2.0/build/fop.jar;D:/libs/serializer-2.7.0.jar;D:/libs/xalan- 2.7.0.jar;D:/libs/xercesImpl-2.7.1.jar;D:/libs/xml-apis-1.3.04.jar;D:/libs/batik-all-1.7.jar; 2. command I am using to generate the pdf is : java -jar fop.jar -xml D:/json/person.xml -xsl D:/altova_xslt_file/Barcode4J_test.xslt -pdf D:/altova_xslt_file/Barcode4J_test.pdf 3. I am using the below names in the XSLT xmlns:barcode="org.krysalis.barcode4j.xalan.BarcodeExt" extension-element-prefixes="barcode" 4. Barcode generating piece <fo:block> <fo:instream-foreign-object> <barcode:barcode xmlns:barcode="org.krysalis.barcode4j.xalan.BarcodeExt" message="my message" orientation="90"> <barcode:code128> <barcode:height>8mm</barcode:height> </barcode:code128> </barcode:barcode> </fo:instream-foreign-object> </fo:block> 5. I am getting the below error it is not able to find the class in the classpath although I have added the jar on: org.krysalis.barcode4j.xalan.BarcodeExt Dec 13, 2015 11:09:35 AM org.apache.fop.cli.Main startFOP SEVERE: Exception org.apache.fop.apps.FOPException: javax.xml.transform.TransformerException: java.lang.ClassNotFoundException: org.krysalis.barcode4j.xalan.BarcodeExt javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: java.lang.ClassNotFoundException: org.krysalis.barcode4j.xalan.BarcodeExt at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:288) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) at org.apache.fop.cli.Main.startFOP(Main.java:186) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.fop.cli.Main.startFOPWithDynamicClasspath(Main.java:143) at org.apache.fop.cli.Main.main(Main.java:219) Caused by: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: java.lang.ClassNotFoundException: org.krysalis.barcode4j.xalan.BarcodeExt at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.processElement(ExtensionHandlerJavaPackage.java:491) at org.apache.xalan.templates.ElemExtensionCall.execute(ElemExtensionCall.java:232) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:285) ... 8 more Please help me to resolve the issue.. Thanks, Siva |