- Code: Select all
org.docx4j.openpackaging.exceptions.Docx4JException: FOP issues
at org.docx4j.convert.out.pdf.viaXSLFO.Conversion.output(Conversion.java:374)
Caused by: javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: For "fo:root", "fo:layout-master-set" must be declared before "fo:page-sequence"! (See position 1:168)
This is with any kind of docx file, large or small. Here's a little more of the trace:
- Code: Select all
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Unknown Source)
at org.docx4j.convert.out.pdf.viaXSLFO.Conversion.output(Conversion.java:362)
... 4 more
Caused by: org.apache.fop.fo.ValidationException: For "fo:root", "fo:layout-master-set" must be declared before "fo:page-sequence"! (See position 1:168)
at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:54)
at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
at $Proxy34.nodeOutOfOrder(Unknown Source)
at org.apache.fop.fo.FONode.nodesOutOfOrderError(FONode.java:502)
at org.apache.fop.fo.FONode.nodesOutOfOrderError(FONode.java:488)
at org.apache.fop.fo.pagination.Root.validateChildNode(Root.java:128)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:267)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:171)
at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(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)
Whilst running the export, I can see FO outputting to the console, along with repeated instances of this "javax.xml.transform.TransformerException: java.lang.NoClassDefFoundError: org.plutext.jaxb.xslfo.ObjectFactory" error (see trace below). Could this be the root cause? And if so, any ideas what the problem is?
I wrote some code ages ago using docx4j 2.7.1 which runs PDFs just fine, but I'm not having any joy now. My heap size is set to 512m so I don't think that's the problem. I'm using fop v1.0 and when I upload the very same source document to the docx4j web app, that generates a PDF just fine.
Any ideas? Is this a problem with my JAXB implementation? (I added the latest JAXB release to my classpath but that doesn't seem to make any difference). Here's the full trace re the JAXB ObjectFactory:
- Code: Select all
javax.xml.transform.TransformerException: java.lang.NoClassDefFoundError: org.plutext.jaxb.xslfo.ObjectFactory
at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(Unknown Source)
at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(Unknown Source)
at org.apache.xalan.extensions.ExtensionsTable.extFunction(Unknown Source)
at org.apache.xalan.transformer.TransformerImpl.extFunction(Unknown Source)
at org.apache.xpath.functions.FuncExtFunction.execute(Unknown Source)
at org.apache.xpath.XPath.execute(Unknown Source)
at org.apache.xalan.templates.ElemCopyOf.execute(Unknown Source)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Unknown Source)
at org.apache.xalan.templates.ElemLiteralResult.execute(Unknown Source)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(Unknown Source)
at org.apache.xalan.templates.ElemApplyTemplates.execute(Unknown Source)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Unknown Source)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Unknown Source)
at org.apache.xalan.transformer.TransformerImpl.transformNode(Unknown Source)
at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source)
at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source)
at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source)
at org.docx4j.XmlUtils.transform(XmlUtils.java:909)
at org.docx4j.XmlUtils.transform(XmlUtils.java:802)
at org.docx4j.convert.out.pdf.viaXSLFO.Conversion.output(Conversion.java:349)