Thank you for this information.
On 01/20/2019 09:10 PM, Robert Bentall wrote:
Hello Hussein,
I created an Ant script based on the contents of xxetool.bat. This
worked both when run locally and on a server running Jenkins. This has a
keyboard and display anyway, so not headless. Script as follows (needs
cleanup).
Thanks,
Rob
<project name="MyDocProject" default="build" basedir=".">
<property name="docbook_name" value="MyDoc"/>
<property name="jvm" value="C:\Program
Files\Java\OpenJDK8-192-jre\bin\java"/>
<!-- Project directories. -->
<property name="xmlmind_home"
value="..\..\..\..\Tools\XMLmind_XML_Editor" />
<property name="xmlmind_bin" value="${xmlmind_home}\bin" />
<property name="docbook.dir" location="docbook"/>
<property name="build.dir" location="build"/>
<path id="xml_mind.classpath">
<pathelement location="${xmlmind_bin}\"/>
<pathelement location="${xmlmind_bin}\xxe.jar"/>
<pathelement location="${xmlmind_bin}\xerces.jar"/>
<pathelement location="${xmlmind_bin}\resolver.jar"/>
<pathelement location="${xmlmind_bin}\relaxng.jar"/>
<pathelement location="${xmlmind_bin}\saxon.jar"/>
<pathelement location="${xmlmind_bin}\saxon9.jar"/>
</path>
<macrodef name="ConvertToPdf">
<attribute name="InputFile" />
<attribute name="OutputFile" />
<sequential>
<java
dir="${xmlmind_bin}"
classname="com.xmlmind.xmleditapp.tool.StartTool"
classpathref="xml_mind.classpath"
jvm="${jvm}"
fork="true"
failonerror="true"
maxmemory="128m"
>
<jvmarg value="-Xss4m"/>
<jvmarg value="-Xmx512m"/>
<arg value="convert"/>
<arg value="db51.toPSFile"/>
<arg value="@{InputFile}"/>
<arg value="-s" />
<arg value="pdf" />
<arg value="-s" />
<arg value='"|pdf"' />
<arg value="-u" />
<arg value="@{OutputFile}"/>
</java>
</sequential>
</macrodef>
<target name="clean">
<delete dir="${build.dir}"/>
<mkdir dir="${build.dir}"/>
</target>
<target name="build" depends="clean">
<echo message="xmlmind_home:${xmlmind_home}" />
<echo message="docbook_name:${docbook_name}" />
<ConvertToPdf
InputFile="${docbook.dir}/${docbook_name}/DocbookSource.xml"
OutputFile="${build.dir}/${docbook_name}.pdf" />
</target>
</project>
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On Fri, 18 Jan 2019 at 09:24, Hussein Shafie <[email protected]
<mailto:[email protected]>> wrote:
On 01/17/2019 09:10 PM, Robert Bentall wrote:
>
> Thank you for your swift response, that's just what I needed. It now
> works as I expect.
>
> In this
> document
http://www.xmlmind.com/xmleditor/_distrib/doc/xxetool/xxetool.pdf
> there is a note that "The xxetool command-line tool will not run on a
> headless server".
>
> What does that mean in practice? If I can run it via a command
line, I'd
> expect to be able to create (eg) a jenkins build running on a VM to
> create my documentation.
>
The xxetool command-line utility is a special (special, NOT stripped
down) variant of the XMLmind XML Editor desktop application.
Hence its code contains *thousands* of invocations of graphical
libraries (java.awt, javax.swing, javafx, etc) which are likely to
raise
"java.awt.HeadlessException" exceptions when XMLmind XML Editor is run
on a headless server.
A "java.awt.HeadlessException" is defined as follows: "Thrown when code
that is dependent on a keyboard, display, or mouse is called in an
environment that does not support a keyboard, display, or mouse."
Please give xxetool a try on VM+Jenkins. If it does not work
(java.awt.HeadlessException) then I'll suggest to ask the Jenkins
support forum for a workaround (Xvfb?
https://en.wikipedia.org/wiki/Xvfb; Xdummy?), because this should be a
common issue.
We would be grateful if you could share the results of your
investigations with this mailing list.
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support