Formerly working PDF export project now failing, may be related to PDF Chemistry?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
standard_user_id
Posts: 2
Joined: Wed May 25, 2022 7:58 pm

Formerly working PDF export project now failing, may be related to PDF Chemistry?

Post by standard_user_id »

Hi, wonderful community:

I've inherited a very large documentation project, in which all of the transformations were created by someone who's now on medical disability and can't be brought back in to troubleshoot the problem. So, I'm clueless and thank you in advance for your help. I know how to create topics and subtopics and links and whatnot, but the magic that turns it into a PDF is, to me, legit magic.

Ever since I started adding topics and subtopics to the project, I've been able to use the original transformation to create a good-looking PDF. However, I went a couple of weeks without transforming to PDF, and now when I run it, it fails with this fatal error:

Transformation failed. C:\Program Files\Oxygen XML Editor 24\frameworks\dita\DITA-OT3.x\plugins\com.oxygenxml.pdf.css\build.xml:661: Java returned: 1

So I went to line 661 of the long build.xml file, which I have never opened because I don't understand anything except how to add topics, style text, and create links. Here's the section that contains line 661, which is under the target for pdf-css.chemistry.embedded.
build-xml-line661-section.png
build-xml-line661-section.png (43.33 KiB) Viewed 109 times
.

<target name="pdf-css.chemistry.embedded" if="use.chemistry" unless="use.chemistry.external">
<echo>=============================</echo>
<echo>Oxygen PDF Chemistry</echo>
<echo>Installation directory: ${embedded.chemistry.installation.dir}</echo>
<echo>Processing: ${dita.map.merged.post.processed}</echo>
<echo>Output file: ${outputFile}</echo>
<echo>=============================</echo>
<condition property="final.input.file" value="${dita.map.output.dir}/${outputFile.base}.final.xml" else="${dita.map.merged.post.processed}">
<equals arg1="${storeTypeMemory}" arg2="true"/>
</condition>
<antcall target="copyXHTML" inheritrefs="true" if:set="storeTypeMemory">
<param name="src" value="${dita.map.merged.post.processed}"/>
<param name="dest" value="${final.input.file}"/>
</antcall>

<property name="baseJVMArgLine" value=""/>
<java fork="true" failonerror="true" logerror="true"
classname="com.oxygenxml.chemistry.OxygenPDFChemistry" unless:set="skip.pdf">
<jvmarg line="-Djava.awt.headless=true ${baseJVMArgLine}"/>

Line 661 is this one, with a classname for OxygenPDFChemistry:
<java fork="true" failonerror="true" logerror="true"
classname="com.oxygenxml.chemistry.OxygenPDFChemistry" unless:set="skip.pdf">
Ransacking my drive for anything that contains "chemistry," I can find nothing for PDF Chemistry:

* C:\Program Files\Oxygen XML Editor 24\lib\oxygen-pdf-chemistry.jar, created on the day I first installed Oxygen
* .chemistry-cache in the C:/Users/myname folder, last touched yesterday
* C:\Program Files\Oxygen XML Editor 24\oxygenChemistry.bat
* C:\Program Files\Oxygen XML Editor 24\tools\chemistry\build_chemistry.xml
* C:\Users\myname\AppData\Roaming\com.oxygenxml.chemistry (empty folder)
* C:\Users\myname\AppData\Local\Temp\chemistry-temp
* C:\Program Files\Oxygen XML Editor 24\tools\chemistry folder, containing file build_chemistry XML.

When I revert to an older version of the project, the PDF transforms correctly. So, is it possible that something in the new content I've recently created is calling this specific thing, and that's making it hork? Or something else?

I can go back to the version of the project that worked and add in the new content a bit at a time until I can see if a specific file is breaking it. But, if it's something for which there's an easy fix like installing a package or correcting a file path, that would be awesome.

Thanks in advance for any help you can provide. Fingers crossed that this is a newb problem with a really easy fix that I can understand. Pretty sure I can follow the steps to output the log, if that's also helpful.

--Elissa M.
Attachments
image.png
image.png (42.78 KiB) Viewed 109 times
julien_lacour
Posts: 257
Joined: Wed Oct 16, 2019 3:47 pm

Re: Formerly working PDF export project now failing, may be related to PDF Chemistry?

Post by julien_lacour »

Hi Elissa,

If you are in Oxygen, when the transformation fails, there should be two different tabs displayed in Oxygen:
results.png
results.png (7.33 KiB) Viewed 104 times
The tab named after the transformation (underlined) contains the console log of the transformation and should contains the stacktrace of the error too.

You should consider sending us this console output directly at support@oxygenxml.com for analysis. Don't forget to indicate the version of Oxygen you are using.

Regards,
Julien
standard_user_id
Posts: 2
Joined: Wed May 25, 2022 7:58 pm

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space (was Re: Formerly working PDF...

Post by standard_user_id »

I looked at the much more useful verbose output, and right before it fails, there's an exception that looks like a Java out-of-memory error. Prior to the snip below, the 5,652 earlier pages were rendered correctly. Again, I inherited this, so any best practices about managing immense file sets may not be in place.

Thanks,
Elissa

--snip
[java] INFO FOUserAgent - Rendered page #5653.
[java] Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
[java] at java.base/java.util.Arrays.copyOf(Arrays.java:3537)
[java] at java.base/java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:185)
[java] at com.oxygenxml.chemistry.e.eb.b(Unknown Source)
[java] at com.oxygenxml.chemistry.OxygenPDFChemistry.b(Unknown Source)
[java] at com.oxygenxml.chemistry.OxygenPDFChemistry.processInternal(Unknown Source)
[java] at com.oxygenxml.chemistry.OxygenPDFChemistry$1.b(Unknown Source)
[java] at com.oxygenxml.chemistry.OxygenPDFChemistry$1.run(Unknown Source)
[java] at ro.sync.security.SandboxCore.runWithConfirmation(SandboxCore.java:258)
[java] at ro.sync.security.ConnectionsSandbox.runWithConnectConfirmation(ConnectionsSandbox.java:263)
[java] at ro.sync.security.Sandbox.runWithConnectConfirmation(Sandbox.java:355)
[java] at com.oxygenxml.chemistry.OxygenPDFChemistry.process(Unknown Source)
[java] at com.oxygenxml.chemistry.OxygenPDFChemistry.process(Unknown Source)
[java] at com.oxygenxml.chemistry.OxygenPDFChemistry.process(Unknown Source)
[java] at com.oxygenxml.chemistry.OxygenPDFChemistry.main(Unknown Source)

BUILD FAILED
C:\Program Files\Oxygen XML Editor 24\frameworks\dita\DITA-OT3.x\plugins\org.dita.base\build.xml:29: The following error occurred while executing this line:
C:\Program Files\Oxygen XML Editor 24\frameworks\dita\DITA-OT3.x\plugins\com.oxygenxml.pdf.css\build.xml:519: The following error occurred while executing this line:
C:\Program Files\Oxygen XML Editor 24\frameworks\dita\DITA-OT3.x\plugins\com.oxygenxml.pdf.css\build.xml:661: Java returned: 1

Total time: 65 minutes 24 seconds

The process finished with exit code: 1
julien_lacour
Posts: 257
Joined: Wed Oct 16, 2019 3:47 pm

Re: Formerly working PDF export project now failing, may be related to PDF Chemistry?

Post by julien_lacour »

Hi Elissa,

It is, as you mentioned, a Java out-of-memory error, Oxygen PDF Chemistry has a default memory allocation of 512MB that can be increased.
Just follow the indications from this topic: https://www.oxygenxml.com/doc/ug-ope/to ... emory.html

Regards,
Julien,
Post Reply