Hi,
I installed the fop.war as Jeremias adviced me.
I first tries to create a PDF with a fo file.
http://maq.srv.fr:8080/fop/fop?fo=/home/srv/webapps/opencms/export/xsl/decompte.fo
The server sends the following error message? Can anybody tell me which
jar file is missing ?
Best regards,
Xavier
Etat HTTP 500 -
------------------------------------------------------------------------
*type* Rapport d''exception
*message*
*description* _Le serveur a rencontré une erreur interne () qui l'a
empèché de satisfaire la requête._
*exception*
javax.servlet.ServletException: L''exécution de la servlet a lancé une exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:222)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:534)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
*root cause*
java.lang.UnsatisfiedLinkError: /usr/j2sdk1.4.2_04/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:1560)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477)
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)
at
org.apache.fop.fo.expr.NCnameProperty.getColor(NCnameProperty.java:52)
at
org.apache.fop.fo.properties.ColorProperty$Maker.convertProperty(ColorProperty.java:80)
at
org.apache.fop.fo.properties.PropertyMaker.make(PropertyMaker.java:442)
at
org.apache.fop.fo.properties.PropertyMaker.make(PropertyMaker.java:392)
at
org.apache.fop.fo.properties.PropertyMaker.get(PropertyMaker.java:299)
at org.apache.fop.fo.PropertyList.get(PropertyList.java:174)
at org.apache.fop.fo.StaticPropertyList.get(StaticPropertyList.java:72)
at org.apache.fop.fo.PropertyList.get(PropertyList.java:154)
at
org.apache.fop.fo.properties.CommonBorderPaddingBackground.<init>(CommonBorderPaddingBackground.java:147)
at
org.apache.fop.fo.PropertyList.getBorderPaddingBackgroundProps(PropertyList.java:577)
at org.apache.fop.fo.pagination.Region.bind(Region.java:64)
at org.apache.fop.fo.pagination.RegionBody.bind(RegionBody.java:56)
at org.apache.fop.fo.FObj.processNode(FObj.java:118)
at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:321)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1020)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:452)
at org.apache.fop.servlet.FopServlet.render(FopServlet.java:241)
at org.apache.fop.servlet.FopServlet.renderFO(FopServlet.java:180)
at org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:696)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:534)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Xavier Ottolini a écrit :
Hi,
You are right, my Tomcat server is a jakarta-tomcat-4.1.31
I'll check the fop.war.
Thank you Jeremias
Jeremias Maerki a écrit :
I've just tried running the FOP servlet in Tomcat 5.5.9 with the
projectteam example in examples/embedding/xml and I can't reproduce it
which means I have to more closely build the environment you guys have.
Xavier, AFAIK there is no Tomcat 4.3. The latest Tomcat 4.x version is
4.1.34. If we are to reproduce the problem the environment must be as
precise as possible.
Can those who have this problem please deploy fop.war in your
web container, run the projectteam example and check if the problem
surfaces?
URL:
http://localhost:8080/fop/?xml=[..]/examples/embedding/xml/xml/projectteam.xml&xslt=[..]/examples/embedding/xml/xslt/projectteam2fo.xsl
On 22.01.2007 11:07:07 Xavier Ottolini wrote:
Hi,
I have got the same problem. When I run FOP as embedded in my
developement server, it is ran without any error. But when I run it
on my production server, I have got the following exception :
org.apache.fop.fo.ValidationException: Error(Unknown location): For
fo:simple-page-master, only one fo:region-body may be declared.
I tried to run the your website example ExampleXML2PDF and I have
got the same issue
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)
I use the following libraries
activation.jar
avalon-framework-4.2.0.jar
batik-all-1.6.jar
commons-io-1.2.jar
commons-logging-1.0.4.jar
dom.jar
fesi.jar
fop.jar
jug.jar
lucene-1.2.jar
mail.jar
mysql-connector-java-3.0.7-stable-bin.jar
newsmodule.jar
opencms.jar
rss4j.jar
serializer-2.7.0.jar
Tidy.jar
xalan-2.7.0.jar
xercesImpl-2.6.2.jar
xml-apis-2.6.2.jar
xmlgraphics-commons-1.1.jar
I use xerces-J 2.6.2 because with the 2.7.1, Tomcat 4.3 crashes at
startup.
Here is a extract of my XSL :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/decompte">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="decomptes"
page-height="29.7cm"
page-width="21cm"
margin-top="2cm"
margin-bottom="1cm"
margin-left="2.5cm"
margin-right="2.5cm">
<fo:region-body margin-top="1cm" margin-bottom="2cm"/>
<fo:region-before region-name="header" extent="3cm"/>
<fo:region-after region-name="footer" extent="1.5cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="decomptes">
<fo:static-content flow-name="footer">
<fo:block text-align="right">
Page
<fo:page-number />/<fo:page-number-citation ref-id="theEnd" />
</fo:block>
</fo:static-content>
<fo:static-content flow-name="header">
<fo:block-container height="7cm" width="100%" top="7cm" left="0cm"
position="absolute">
<fo:block background-color="transparent">
<fo:external-graphic
src="../system/galleries/pics/decompte/copie-conforme.svg"
content-height="6.7cm"
vertical-align="middle" />
</fo:block>
</fo:block-container>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
...
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
Where does it come from ?
Best regards,
Xavier
Jeremias Maerki a écrit :
On 11.01.2007 01:22:04 pwillsey wrote:
Jeremias Maerki-2 wrote:
Ok, in this case I'd modify the application so you can write out the
generated FO within your application. Maybe there's something
special
about that environment.
I modified the application to do this and then I ran the fo file
that was
created through one of the FOP examples provided on your webpage
(ExampleFO2PDF.java) and it successfully converted it from FO to PDF.
So, that means if you run it through FOP in your application, it
doesn't
work but if you serialize the XSLT processor's output to an FO file
(instead of calling FOP) in the same environment and format the
resulting file it works. Is that correct? If yes, it's a really weird
problem I cannot help without getting my hands on the whole thing.
Sorry.
Jeremias Maerki-2 wrote:
I'm sure you did it right, but are you certain that you properly
override the default XSLT implementation with Xalan 2.7.0 using the
endorsed standards override mechanism?
No I'm not sure I didn't write the code originally I'm very new to
using
FOP.
In that case, I suggest you read
http://xmlgraphics.apache.org/fop/faq.html#svg-attribute-required.
Because if you don't know how to properly replace the JAXP
implementations in an environment, you're never sure what version
you're
working with.
Here is the code that does the transformation it looks like some
of it
came from your examples page:
That code snippet doesn't really help because it doesn't show how you
instantiate the TransformerFactory and how your code looks if you just
serialize to an FO file for testing purposes.
protected byte[] transform() {
byte[] result = null;
_errorCondition = false;
try {
// Setup output
ByteArrayOutputStream out = new ByteArrayOutputStream();
BufferedOutputStream bout = new BufferedOutputStream(out);
try {
// Construct fop with desired output format
Fop fop = this.fopFactory().newFop(MimeConstants.MIME_PDF, bout);
// Setup XSLT
Transformer transformer = this.xsltTransformer();
// Set the value of a <param> in the stylesheet
transformer.setParameter("versionParam", "2.0");
transformer.setErrorListener(this);
if (logger.isDebugEnabled()) {
StringBuffer aLog = new StringBuffer();
aLog.append("transformer properties:\n");
Properties properties = transformer.getOutputProperties();
for (Iterator iterator = properties.keySet().iterator();
iterator.hasNext();) {
String key = (String) iterator.next();
aLog.append("\t property:" + key + " value:" + properties.get(key));
}
logger.debug(aLog.toString());
}
// Setup input for XSLT transformation
Source src = this.xsltInput();
// Resulting SAX events (the generated FO) must be piped through
// to FOP
Result res = new SAXResult(fop.getDefaultHandler());
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
// Result processing
FormattingResults foResults = fop.getResults();
if (logger.isDebugEnabled()) {
logger.debug("foResults " + foResults);
}
bout.flush();
result = out.toByteArray();
} finally {
out.close();
}
} catch (Exception exception) {
if (logger.isEnabledFor(org.apache.log4j.Level.ERROR)) {
logger.error("Exception ", exception);
}
result = new byte[] {};
}
if (_errorCondition)
result = new byte[] {};
return result;
}
The Exception Occurs on this line:
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
Jeremias Maerki-2 wrote:
I don't think the difference in processor technology should make any
difference here. Normally, the choice of JVM and application
server is a
more likely cause.
On 10.01.2007 18:48:12 pwillsey wrote:
I ran the transformation from both computers on the command
line, the FO
file
was identical and did not contain a fo:simple-page-master
element with
more
then one fo:region-body. I'm using Xalan 2.7.0 on both machines
for XSLT
processing. Not sure if this is relevant but the machine I'm having
problems with is running OS X with an intel chip and the
development
machine
is a powerpc.
Jeremias Maerki-2 wrote:
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.
On 10.01.2007 06:33:05 pwillsey wrote:
Hello,
I'm getting a validation exception:
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.
But I've checked the XLST sheet and there is no
fo:simple-page-master
element with more then one fo:region-body. I've also tested
this on
another
machine and it works fine. I'm using FOP V. 0.93 (on Both
machines).
Not sure if this makes a difference but I'm using FOP in a
webobjects
project and I get the exception when I deploy the project but
not when
I
run
it using eclipse on my development machine.
Any help would be greatly Appreciated
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]
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]