Here is my code snippet:
WordDocument.java is extended by Organizer.java:
- Code: Select all
public WordprocessingMLPackage getWordMLPackage() {
return wordMLPackage;
}
public void saveToWordFile(String name){
File file = new File(name);
try {
this.getWordMLPackage().save(file);
} catch (Docx4JException e) {
e.printStackTrace();
}
}
public void saveToPdfFile(String name){
//saveToWordFile(name);
try {
OutputStream out = new FileOutputStream(name);
Docx4J.toPDF(this.getWordMLPackage(), out);
} catch (Exception e) {
e.printStackTrace();
}
}
AssembleOrganizer.java
- Code: Select all
public void compileNsaveToDocx() {
this.organizer = new Organizer(start, end);
organizer.compile();
organizer.saveToWordFile(DATE.clndr2Str(start)+".docx");
}
public void compileNsaveToPdf() {
this.organizer = new Organizer(start, end);
organizer.compile();
organizer.saveToPdfFile(DATE.clndr2Str(start)+".pdf");
}
public static void main(String[] args) {
AssembleOrganizer a = new AssembleOrganizer(2021);
//a.compileNsaveToDocx();
a.compileNsaveToPdf();
}
The errors I am getting with docx4j3.2.1 are :
- Code: Select all
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector$1 (file:/C:/workspace/lib/CalendarLibs/rt.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[main] INFO org.docx4j.jaxb.NamespacePrefixMapperUtils - Using NamespacePrefixMapperSunInternal, which is suitable for Java 6
[main] INFO org.docx4j.jaxb.Context - Using Java 6/7 JAXB implementation
[main] INFO org.docx4j.jaxb.Context - Not using MOXy; using com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl
[main] INFO org.docx4j.model.structure.PageDimensions - Using paper size: A4
[main] INFO org.docx4j.model.structure.PageDimensions - Landscape orientation: false
[main] INFO org.docx4j.openpackaging.parts.relationships.RelationshipsPart - adding part with proposed name: /word/document.xml
[main] INFO org.docx4j.openpackaging.Base - shortcut was set
[main] INFO org.docx4j.openpackaging.parts.JaxbXmlPartXPathAware - For org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart, unmarshall via binder
[main] WARN org.docx4j.XmlUtils - default SAXParserFactory property : null
Please consider using Xerces.
[main] WARN org.docx4j.XmlUtils - default DocumentBuilderFactory property: null
Please consider using Xerces.
[main] INFO org.docx4j.openpackaging.parts.relationships.RelationshipsPart - adding part with proposed name: /word/styles.xml
[main] INFO org.docx4j.openpackaging.Base - shortcut was set
[main] INFO org.docx4j.utils.XPathFactoryUtil - xpath implementation: org.apache.xpath.jaxp.XPathFactoryImpl
[main] INFO org.docx4j.openpackaging.parts.relationships.RelationshipsPart - adding part with proposed name: /docProps/core.xml
[main] INFO org.docx4j.openpackaging.Base - shortcut was set
[main] INFO org.docx4j.openpackaging.parts.relationships.RelationshipsPart - adding part with proposed name: /docProps/app.xml
[main] INFO org.docx4j.openpackaging.Base - shortcut was set
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Style with name Default Paragraph Font, id 'DefaultParagraphFont' is default character style
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Style with name Normal, id 'Normal' is default paragraph style
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Set virtual style, id 'DocDefaults', name 'DocDefaults'
[main] INFO org.docx4j.model.structure.PageDimensions - Using paper size: A4
[main] INFO org.docx4j.model.structure.PageDimensions - Landscape orientation: false
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/ALGER.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/BAUHS93.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/BERNHC.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/BROADW.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/CHILLER.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/ELEPHNTI.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/Gabriola.ttf (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/GIGI.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/HARLOWSI.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/HARNGTON.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/HATTEN.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/impact.ttf (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/ITCBLKAD.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/JOKERMAN.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/JUICE___.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/PLAYBILL.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/SNAP____.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/STENCIL.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] WARN org.docx4j.fonts.PhysicalFonts - Aborting: file:/C:/WINDOWS/FONTS/TEMPSITC.TTF (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart - fontsInUse..
[main] INFO org.docx4j.fonts.RunFontSelector - No theme part - default to Calibri
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart - fontsInUse..
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Found existing style named DocDefaults
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Style with name Normal, id 'Normal' is default paragraph style
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Style with name Default Paragraph Font, id 'DefaultParagraphFont' is default character style
[main] INFO org.docx4j.fonts.RunFontSelector - No theme part - default to Calibri
[main] INFO org.docx4j.convert.out.common.preprocess.FieldsCombiner - starting
[main] INFO org.docx4j.convert.out.common.preprocess.CoverPageSectPrMover - No need to move sectPr
[main] INFO org.docx4j.openpackaging.parts.relationships.RelationshipsPart - adding part with proposed name: /word/settings.xml
[main] INFO org.docx4j.openpackaging.Base - shortcut was set
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Style with name Normal Table, id 'TableNormal' is default table style
[main] WARN org.docx4j.model.structure.PageDimensions - No pgSz in this section; defaulting.
[main] INFO org.docx4j.model.structure.PageDimensions - Using paper size: A4
[main] INFO org.docx4j.model.structure.PageDimensions - Landscape orientation: false
[main] INFO org.docx4j.fonts.RunFontSelector - No theme part - default to Calibri
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart - Preparing StyleTree
[main] INFO org.docx4j.convert.out.common.AbstractConversionContext - /pkg:package
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart - fontsInUse..
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Found existing style named DocDefaults
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Style with name Normal, id 'Normal' is default paragraph style
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Style with name Default Paragraph Font, id 'DefaultParagraphFont' is default character style
[main] INFO org.docx4j.fonts.RunFontSelector - No theme part - default to Calibri
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart - fontsInUse..
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Found existing style named DocDefaults
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Style with name Normal, id 'Normal' is default paragraph style
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart - Style with name Default Paragraph Font, id 'DefaultParagraphFont' is default character style
[main] INFO org.docx4j.fonts.RunFontSelector - No theme part - default to Calibri
[main] INFO org.docx4j.convert.out.common.preprocess.FieldsCombiner - starting
[main] INFO org.docx4j.convert.out.common.preprocess.CoverPageSectPrMover - No need to move sectPr
[main] WARN org.docx4j.model.structure.PageDimensions - No pgSz in this section; defaulting.
[main] INFO org.docx4j.model.structure.PageDimensions - Using paper size: A4
[main] INFO org.docx4j.model.structure.PageDimensions - Landscape orientation: false
[main] INFO org.docx4j.fonts.RunFontSelector - No theme part - default to Calibri
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart - Preparing StyleTree
[main] INFO org.docx4j.convert.out.common.AbstractConversionContext - /pkg:package
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart - fontsInUse..
[main] INFO org.docx4j.fonts.RunFontSelector - No theme part - default to Calibri
[main] WARN org.docx4j.convert.out.fo.renderers.FORendererApacheFOP - Can't set up FOP svn; org.apache.fop.apps.FopConfParser
[main] WARN org.apache.fop.apps.FOUserAgent - Font "Calibri,normal,400" not found. Substituting with "any,normal,400".
[main] INFO org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart - fontsInUse..
[main] INFO org.docx4j.fonts.RunFontSelector - No theme part - default to Calibri
[main] WARN org.docx4j.convert.out.fo.renderers.FORendererApacheFOP - Can't set up FOP svn; org.apache.fop.apps.FopConfParser
[main] WARN org.apache.fop.apps.FOUserAgent - table-layout="fixed" and column-width unspecified => falling back to proportional-column-width(1) (See position 3:120)
[main] ERROR org.docx4j.convert.out.common.AbstractExporter - Exception exporting package
java.lang.StringIndexOutOfBoundsException: begin 0, end 9, length 8
at java.base/java.lang.String.checkBoundsBeginEnd(Unknown Source)
at java.base/java.lang.String.substring(Unknown Source)
at org.apache.fop.fo.expr.PropertyTokenizer.nextColor(PropertyTokenizer.java:239)
at org.apache.fop.fo.expr.PropertyTokenizer.next(PropertyTokenizer.java:175)
at org.apache.fop.fo.expr.PropertyParser.parseProperty(PropertyParser.java:118)
at org.apache.fop.fo.expr.PropertyParser.parse(PropertyParser.java:91)
at org.apache.fop.fo.properties.PropertyMaker.make(PropertyMaker.java:438)
at org.apache.fop.fo.PropertyList.convertAttributeToProperty(PropertyList.java:413)
at org.apache.fop.fo.PropertyList.addAttributesToList(PropertyList.java:321)
at org.apache.fop.fo.FObj.processNode(FObj.java:122)
at org.apache.fop.fo.flow.table.TableFObj.processNode(TableFObj.java:232)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:280)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
at org.docx4j.convert.out.fo.renderers.FORendererApacheFOP.render(FORendererApacheFOP.java:211)
at org.docx4j.convert.out.fo.renderers.FORendererApacheFOP.render(FORendererApacheFOP.java:158)
at org.docx4j.convert.out.fo.AbstractFOExporter.postprocess(AbstractFOExporter.java:139)
at org.docx4j.convert.out.fo.AbstractFOExporter.postprocess(AbstractFOExporter.java:47)
at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:81)
at org.docx4j.Docx4J.toFO(Docx4J.java:467)
at org.docx4j.Docx4J.toPDF(Docx4J.java:481)
at book.word.WordDocument.saveToPdfFile(WordDocument.java:81)
at book.assemble.AssembleOrganizer.compileNsaveToPdf(AssembleOrganizer.java:67)
at book.assemble.AssembleOrganizer.main(AssembleOrganizer.java:76)
org.docx4j.openpackaging.exceptions.Docx4JException: Exception exporting package
at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:96)
at org.docx4j.Docx4J.toFO(Docx4J.java:467)
at org.docx4j.Docx4J.toPDF(Docx4J.java:481)
at book.word.WordDocument.saveToPdfFile(WordDocument.java:81)
at book.assemble.AssembleOrganizer.compileNsaveToPdf(AssembleOrganizer.java:67)
at book.assemble.AssembleOrganizer.main(AssembleOrganizer.java:76)
Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 9, length 8
at java.base/java.lang.String.checkBoundsBeginEnd(Unknown Source)
at java.base/java.lang.String.substring(Unknown Source)
at org.apache.fop.fo.expr.PropertyTokenizer.nextColor(PropertyTokenizer.java:239)
at org.apache.fop.fo.expr.PropertyTokenizer.next(PropertyTokenizer.java:175)
at org.apache.fop.fo.expr.PropertyParser.parseProperty(PropertyParser.java:118)
at org.apache.fop.fo.expr.PropertyParser.parse(PropertyParser.java:91)
at org.apache.fop.fo.properties.PropertyMaker.make(PropertyMaker.java:438)
at org.apache.fop.fo.PropertyList.convertAttributeToProperty(PropertyList.java:413)
at org.apache.fop.fo.PropertyList.addAttributesToList(PropertyList.java:321)
at org.apache.fop.fo.FObj.processNode(FObj.java:122)
at org.apache.fop.fo.flow.table.TableFObj.processNode(TableFObj.java:232)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:280)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
at org.docx4j.convert.out.fo.renderers.FORendererApacheFOP.render(FORendererApacheFOP.java:211)
at org.docx4j.convert.out.fo.renderers.FORendererApacheFOP.render(FORendererApacheFOP.java:158)
at org.docx4j.convert.out.fo.AbstractFOExporter.postprocess(AbstractFOExporter.java:139)
at org.docx4j.convert.out.fo.AbstractFOExporter.postprocess(AbstractFOExporter.java:47)
at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:81)
... 5 more
I switched out docx4j3.2.0 to a more later version of docx4j8.3.0 and this is the error :
- Code: Select all
[main] WARN org.docx4j.utils.ResourceUtils - Couldn't get resource: docx4j.properties
[main] WARN org.docx4j.Docx4jProperties - Couldn't find/read docx4j.properties; docx4j.properties not found via classloader.
[main] INFO org.docx4j.openpackaging.packages.WordprocessingMLPackage - Using paper size: A4
[main] INFO org.docx4j.openpackaging.packages.WordprocessingMLPackage - Landscape orientation: false
[main] INFO org.docx4j.jaxb.Context - java.vendor=Oracle Corporation
[main] INFO org.docx4j.jaxb.Context - java.version=12.0.2
[main] INFO org.docx4j.jaxb.Context - java.vm.name=Java HotSpot(TM) 64-Bit Server VM
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector$1 (file:/C:/Users/Numa/dev/flatiron/labs/java_linux_workspace/CalendarLibs/rt.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[main] INFO org.docx4j.jaxb.Context - Using Java 6+ JAXB implementation
[main] INFO org.docx4j.openpackaging.parts.relationships.RelationshipsPart - adding part with proposed name: /word/document.xml
[main] INFO org.docx4j.XmlUtils - setProperty com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
[main] INFO org.docx4j.XmlUtils - actual: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
[main] INFO org.docx4j.XmlUtils - setProperty com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
[main] INFO org.docx4j.XmlUtils - actual: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
[main] INFO org.docx4j.openpackaging.parts.relationships.RelationshipsPart - adding part with proposed name: /word/styles.xml
[main] INFO org.docx4j.utils.XPathFactoryUtil - xpath implementation: org.docx4j.org.apache.xpath.jaxp.XPathFactoryImpl
[main] INFO org.docx4j.openpackaging.parts.relationships.RelationshipsPart - adding part with proposed name: /docProps/core.xml
[main] INFO org.docx4j.openpackaging.parts.relationships.RelationshipsPart - adding part with proposed name: /docProps/app.xml
[main] INFO org.docx4j.openpackaging.parts.relationships.RelationshipsPart - adding part with proposed name: /word/settings.xml
[main] INFO org.docx4j.Docx4J - No documents4j or FO found); falling back to legacy Converter.
[main] INFO org.docx4j.jaxb.NamespacePrefixMapperUtils - Using com.sun.xml.internal NamespacePrefixMapper
[main] INFO org.docx4j.jaxb.NamespacePrefixMapperUtils - Using com.sun.xml.internal NamespacePrefixMapper
[main] ERROR org.docx4j.services.client.ConverterHttp -
Looks like your endpoint URL 'http://localhost:9016/v1/00000000-0000-0000-0000-000000000000/convert' is wrong
org.docx4j.openpackaging.exceptions.Docx4JException: This behaviour may be Windows client OS specific; please look in the server logs or try a Linux client
at org.docx4j.Docx4J.toPDF(Docx4J.java:764)
at book.word.WordDocument.saveToPdfFile(WordDocument.java:81)
at book.assemble.AssembleOrganizer.compileNsaveToPdf(AssembleOrganizer.java:67)
at book.assemble.AssembleOrganizer.main(AssembleOrganizer.java:76)
Caused by: org.docx4j.services.client.ConversionException: This behaviour may be Windows client OS specific; please look in the server logs or try a Linux client
at org.docx4j.services.client.ConverterHttp.execute(ConverterHttp.java:248)
at org.docx4j.services.client.ConverterHttp.convert(ConverterHttp.java:190)
at org.docx4j.Docx4J.toPDF(Docx4J.java:761)
... 3 more
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:9016 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at org.docx4j.services.client.ConverterHttp.execute(ConverterHttp.java:212)
... 5 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.base/java.net.PlainSocketImpl.connect0(Native Method)
at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
at java.base/java.net.Socket.connect(Socket.java:591)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
... 15 more
Presently using windows OS (swiching out an entire OS for the sake of a library) seems a little much? Any suggestions?