Error running PDF transformation in recent Oxygen
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 185
- Joined: Wed Apr 20, 2005 5:43 pm
- Location: Victoria, BC, Canada
Error running PDF transformation in recent Oxygen
Post by martindholmes »
Hi all,
Running the oxygen-tei plugin's "jTEI PDF" transformation to turn a jTEI article into a PDF, we see this error:
This seems to be a security policy issue, but I'm not sure how we might solve it. Can anyone help?
Cheers,
Martin
Running the oxygen-tei plugin's "jTEI PDF" transformation to turn a jTEI article into a PDF, we see this error:
Code: Select all
transform-fo:
[java] ERROR StatusLogger Could not register mbeans
[java] java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
[java] at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
[java] at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:444)
[java] at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1805)
...
Cheers,
Martin
-
- Posts: 65
- Joined: Fri Jan 18, 2008 5:54 pm
Re: Error running PDF transformation in recent Oxygen
Post by Ron Van den Branden »
Hi all,
Thanks for raising the issue here, Martin. Perhaps it could help to know that this is an ANT transformation scenario, which invokes an XSLT transformation via Java. This is the failing ANT task:
Best,
Ron
Thanks for raising the issue here, Martin. Perhaps it could help to know that this is an ANT transformation scenario, which invokes an XSLT transformation via Java. This is the failing ANT task:
Code: Select all
<target name="transform-fo">
<delete file="${cfd}/${dest.file.basename}.fo"/>
<java classname="net.sf.saxon.Transform">
<arg value="-target:HE"/>
<arg value="-s:${cfd}/${cfne}"/>
<arg value="-xsl:${transformations.base}/pdf/to.xsl"/>
<arg value="-o:${cfd}/${dest.file.basename}.fo"/>
</java>
</target>
Ron
-
- Posts: 185
- Joined: Wed Apr 20, 2005 5:43 pm
- Location: Victoria, BC, Canada
Re: Error running PDF transformation in recent Oxygen
Post by martindholmes »
I see the libs include:
${oxygenHome}/lib/fop.jar
but Oxygen now includes:
oxygen-patched-fop.jar
Ditto for jeuclid-core and others; but we do include
${oxygenHome}/lib/*fop*.jar
Could it be the duplicate references? Or is this something to do with this lib:
${framework(TEI P5)}/xml/tei/jtei_aux/trans/pdf/lib/fontbox-*.jar
${oxygenHome}/lib/fop.jar
but Oxygen now includes:
oxygen-patched-fop.jar
Ditto for jeuclid-core and others; but we do include
${oxygenHome}/lib/*fop*.jar
Could it be the duplicate references? Or is this something to do with this lib:
${framework(TEI P5)}/xml/tei/jtei_aux/trans/pdf/lib/fontbox-*.jar
-
- Posts: 65
- Joined: Fri Jan 18, 2008 5:54 pm
Re: Error running PDF transformation in recent Oxygen
Post by Ron Van den Branden »
Hi Martin,
If this analysis is correct,
Ron
That would surprise me:martindholmes wrote: ↑Wed Feb 10, 2021 9:21 pm Could it be the duplicate references? Or is this something to do with this lib:
${framework(TEI P5)}/xml/tei/jtei_aux/trans/pdf/lib/fontbox-*.jar
- These duplicate entries have always existed, in order to improve compatibility with older Oxygen versions, and have never posed a problem before.
- The error also seems to occur with other ANT targets invoking the <java> task
If this analysis is correct,
- what could be a practicable solution
- or, would there be a way to make ANT invoke the Java version shipped with Oxygen?
Ron
-
- Posts: 65
- Joined: Fri Jan 18, 2008 5:54 pm
Re: Error running PDF transformation in recent Oxygen
Post by Ron Van den Branden »
Ok, after a bit of tinkering I seem to have found a workaround or solution, by specifying that the <java> task should be executed in a forked JVM, which is running as a clone of the JVM running ANT. In concrete: the transformation does succeed when the <java> task is being specified as folows (notice the @fork and @clonevm attributes):
If this makes sense as a generally working solution, I can change the ANT build files for the jTEI transformations in the TEI framework accordingly. Unless there are better solutions?
Best,
Ron
Code: Select all
<target name="transform-fo">
<delete file="${cfd}/${dest.file.basename}.fo"/>
<java classname="net.sf.saxon.Transform" fork="true" clonevm="true">
<arg value="-target:HE"/>
<arg value="-s:${cfd}/${cfne}"/>
<arg value="-xsl:${transformations.base}/pdf/to.xsl"/>
<arg value="-o:${cfd}/${dest.file.basename}.fo"/>
</java>
</target>
Best,
Ron
-
- Posts: 1014
- Joined: Wed Nov 16, 2005 11:11 am
Re: Error running PDF transformation in recent Oxygen
Post by alex_jitianu »
Hello,
Thank you all for all the detective work. First of all, the exception is harmless.
If you take a look at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(MBeanServer), you'll notice how it catches the exception, logs it, and moves forward without JMX support. The log4j JMX support allows one to connect and control the logging system. It is not something that we ever intended to use. We can edit the JTEI PDF scenario and add this property in the JVM Arguments field: -Dlog4j2.disable.jmx=true and the exception will no longer appear.
Alternatively, one could set the system property in the build file {frameworksDir}\tei\xml\tei\jtei_aux\trans\pdf\jtei-pdf.xml:
Best regards,
Alex
Thank you all for all the detective work. First of all, the exception is harmless.
If you take a look at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(MBeanServer), you'll notice how it catches the exception, logs it, and moves forward without JMX support. The log4j JMX support allows one to connect and control the logging system. It is not something that we ever intended to use. We can edit the JTEI PDF scenario and add this property in the JVM Arguments field: -Dlog4j2.disable.jmx=true and the exception will no longer appear.
Alternatively, one could set the system property in the build file {frameworksDir}\tei\xml\tei\jtei_aux\trans\pdf\jtei-pdf.xml:
Code: Select all
<java classname="net.sf.saxon.Transform">
<sysproperty key="log4j2.disable.jmx" value="true"/>
<arg value="-target:HE"/>
<arg value="-s:${cfd}/${cfne}"/>
<arg value="-xsl:${transformations.base}/pdf/to.xsl"/>
<arg value="-o:${cfd}/${dest.file.basename}.fo"/>
</java>
Alex
-
- Posts: 65
- Joined: Fri Jan 18, 2008 5:54 pm
Re: Error running PDF transformation in recent Oxygen
Post by Ron Van den Branden »
Many thanks Alex, I confirm this has solved the issue!
Best,
Ron
Best,
Ron
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service