Hi,
With a Red Hat Linux, I had to install the package RedHat
|xorg-x11-deprecated-libs|.
Since I use the JDK 1.4, setting the following system property in the
JVM command line was enough :
-Djava.awt.headless=true
Now the problem is fixed !
Thanks for your help !
Best Regards,
Xavier
Xavier Ottolini a écrit :
Thanks Jeremias,
I installed j2sdk1.4.2_13.
I put the jars
- xml-apis-1.3.04.jar
- xalan-2.7.0.jar
- xercesImpl-2.7.1.jar
- serializer-2.7.0.jar
in JAVA_HOME/jre/lib/endorsed.
The message is not displayed any more. But another message is now
displayed :
/usr/j2sdk1.4.2_13/bin/java -Djava.awt.headless=true
-classpath /home/srv/fop-0.93/build/fop.jar:
/home/srv/fop-0.93/lib/xalan-2.7.0.jar:
/home/srv/fop-0.93/lib/xercesImpl-2.7.1.jar:
/home/srv/fop-0.93/lib/avalon-framework-4.2.0.jar:
/home/srv/fop-0.93/lib/batik-all-1.6.jar:
/home/srv/fop-0.93/lib/serializer-2.7.0.jar:
/home/srv/fop-0.93/lib/activation.jar:
/home/srv/fop-0.93/lib/commons-io-1.1.jar:
/home/srv/fop-0.93/lib/xmlgraphics-commons-1.1.jar:
/home/srv/fop-0.93/lib/xml-apis-1.3.02.jar:
/home/srv/fop-0.93/lib/commons-logging-1.0.4.jar:
/home/srv/classes/ embedding.ExampleXML2PDF
Preparing...
Input: XML (/home/xavier.ottolini/test.xml)
Stylesheet: /home/xavier.ottolini/test.xsl
Output: PDF (/home/xavier.ottolini/out/ResultXML2PDF.pdf)
Transforming...
Exception in thread "main" java.lang.UnsatisfiedLinkError:
/usr/j2sdk1.4.2_13/jre/lib/i386/libawt.so: libXp.so.6: cannot open
shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1437)
at java.awt.Toolkit.<clinit>(Toolkit.java:1458)
at java.awt.Color.<clinit>(Color.java:250)
at org.apache.fop.util.ColorUtil.initializeColorMap(ColorUtil.java:523)
at org.apache.fop.util.ColorUtil.<clinit>(ColorUtil.java:56)
I read a lot of posts with this error message. I understood that a X
server is required :
http://xmlgraphics.apache.org/fop/0.20.5/graphics.html#batik
I will tell you if this problem is fixed.
Regards,
Xavier
Jeremias Maerki a écrit :
Just putting xalan and xerces in the classpath with JDK 1.4 and later is
not enough to override the original JAXP implementation that comes with
Sun's JDK. Please copy the following JARs to the directory
/usr/j2sdk1.4.2_04/jre/lib/endorsed (you may have to create it):
- xml-apis-1.3.04.jar
- xalan-2.7.0.jar
- xercesImpl-2.7.1.jar
- serializer-2.7.0.jar
Details on this mechanism here:
http://xml.apache.org/xalan-j/faq.html#faq-N100D6
At any rate, you should consider upgrading your JDK version. 1.4.2_04 is
ancient. 1.4.2_13 is current. Or maybe trying Java 5 or 6 might also be
an idea. However, what you're seeing is really strange. I can't explain
it if your FO file is really ok.
Good luck! Please tell us when you got it to work.
On 30.01.2007 11:48:52 Xavier Ottolini wrote:
Hi,
I tried to run the script with a command line. I used
ExampleXML2PDF.class.
/usr/j2sdk1.4.2_04/bin/java -classpath
/home/test/lib/fop.jar:/home/test/lib/xalan-2.7.0.jar:
/home/test/lib/xercesImpl-2.7.1.jar:/home/test/lib/avalon-framework-4.2.0.jar:
/home/test/lib/batik-all-1.6.jar:/home/test/lib/serializer-2.7.0.jar:
/home/test/lib/activation.jar:/home/test/lib/commons-io-1.2.jar:xmlgraphics-commons-1.1.jar:
/home/test/lib/sax.jar:/home/test/lib/xml-apis-1.3.04.jar:
/home/test/lib/xml-apis-1.3.04-ext.jar: /home/test/
embedding.ExampleXML2PDF
I have got the following message :
Preparing...
Input: XML (/home/test/xsl/test.xml)
Stylesheet: /home/test/xsl/test.xsl
Output: PDF (/home/test/out/ResultXML2PDF.pdf)
Transforming...
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error(Unknown location): For
fo:simple-page-master, only one fo:region-body may be declared.
at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:725)
at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:425)
at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:216)
at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2339)
at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160)
at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:668)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1129)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1107)
at embedding.ExampleXML2PDF.main(ExampleXML2PDF.java:98)
Caused by: org.apache.fop.fo.ValidationException: Error(Unknown
location): For fo:simple-page-master, only one fo:region-body may be
declared.
at
org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.java:870)
at
org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandler.java:954)
at
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:308)
at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:716)
... 9 more
---------
org.apache.fop.fo.ValidationException: Error(Unknown location): For
fo:simple-page-master, only one fo:region-body may be declared.
at
org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.java:870)
at
org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandler.java:954)
at
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:308)
at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:716)
at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:425)
at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:216)
at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2339)
at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160)
at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:668)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1129)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1107)
at embedding.ExampleXML2PDF.main(ExampleXML2PDF.java:98)
---------
org.apache.fop.fo.ValidationException: Error(Unknown location): For
fo:simple-page-master, only one fo:region-body may be declared.
at org.apache.fop.fo.FONode.tooManyNodesError(FONode.java:350)
at
org.apache.fop.fo.pagination.SimplePageMaster.validateChildNode(SimplePageMaster.java:123)
at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:303)
at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
at
org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.java:860)
at
org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandler.java:954)
at
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:308)
at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:716)
at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:425)
at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:216)
at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2339)
at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160)
at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:668)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1129)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1107)
at embedding.ExampleXML2PDF.main(ExampleXML2PDF.java:98)
Jeremias Maerki a écrit :
If you haven't done so already, run only the XSLT transformation
outside
your application (on the command-line) and inspect the generated FO
file.
You may also need to verify that you're using the same XSLT
processor in
both environments.
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Pour préservez l’environnement n’imprimez cet e-mail qu’en cas de nécessité.
Xavier Ottolini
Développeur multimédia
Adelis
37 rue d'Engwiller
67350 La Walck
France
Téléphone : +33 (0) 3 69 20 29 02
Télécopie : +33 (0) 3 88 72 29 19
http://www.adelis.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]