DITA OT 1.8.5 Batch file to execute DITA OT command on remote server

199 views
Skip to first unread message

nilesh k

unread,
Feb 4, 2016, 4:19:22 AM2/4/16
to DITA-OT Users


Hello All,

I am newbie to DITA OT world. Appreciate your help to my below query.

Attached are the batch files which we used with DITA OT 1.5.3 version and they worked well. 
Since we wish to move to the latest version of DITA OT i need to write
such batch files to generate the output. I have tried to tweak the file "startDita2OutputCT1.8.5" to suit version 1.8.5 but no luck. I have also tried simple batch file "startDita2OutputCT2.2.2" for version 2.2.2 but this also fails.

Please note that when execute these commands from command line, i get the desired output. 

Thanks in advance.
startDita2OutputCT.txt
startDita2OutputCT1.8.5.txt
startDita2OutputCT2.2.2.txt
startRemote.txt

nilesh k

unread,
Feb 4, 2016, 6:41:34 AM2/4/16
to DITA-OT Users
Below is the Error message i get:


prompt.init:

prompt:
     [echo] Please enter the filename for the DITA map that you 
     [echo] want to build including the directory path (if any).
     [echo] The filename must have the .ditamap extension.
     [echo] Note that relative paths that climb (..) are not supported yet.
     [echo] To build the sample, press return without entering anything.
    [input] skipping input as property prompt.ditamap.filename has already been set.
     [echo] 
     [echo] Please enter the name of the output directory or press return
     [echo] to accept the default.
    [input] skipping input as property prompt.output.directory has already been set.
     [echo] 
     [echo] Please enter the type of output to generate.
     [echo] Options include: eclipse, tocjs, htmlhelp, javahelp, pdf, or web
     [echo] Use lowercase letters.
     [echo]
    [input] skipping input as property prompt.output.type has already been set.
     [echo] 
     [echo] Ready to build dx\modified.resolved.variables\0fb6f50a-50a2-4967-a474-28cfa1f3170c.ditamap
     [echo] for pdf in out\20160204_1128289584
     [echo]
    [input] skipping input as property prompt.output.confirm has already been set.

use.init:

init:
    [mkdir] Created dir: V:\temp\temp20160204112834543

prompt.output.init:

prompt.output.eclipse:

prompt.output.tocjs:

prompt.output.javahelp:

prompt.output.htmlhelp:

prompt.output.pdf:

DOST.init:

dita2pdf2.init:

start-process:

init-logger:

init-URIResolver:

use-init:

check-arg:
   [delete] Deleting directory V:\temp
    [mkdir] Created dir: V:\temp
     [echo] *****************************************************************
     [echo] * basedir = V:\
     [echo] * dita.dir = V:\
     [echo] * input = dx\modified.resolved.variables\0fb6f50a-50a2-4967-a474-28cfa1f3170c.ditamap
     [echo] * inputdir = V:\dx\modified.resolved.variables
     [echo] * transtype = pdf
     [echo] * tempdir = temp
     [echo] * outputdir = out\20160204_1128289584
     [echo] * extname = ${dita.ext}
     [echo] * clean.temp = true
     [echo] * DITA-OT version = 1.8.5
     [echo] * XML parser = Xerces in Sun JDK 1.5
     [echo] * XSLT processor = Saxon
     [echo] * collator = ICU
     [echo] *****************************************************************
     [echo] #Ant properties
     [echo] #Thu Feb 04 11:28:35 UTC 2016
     [echo] args.css.file.temp=${args.css}
     [echo] args.css.real=${args.css}
     [echo] args.grammar.cache=yes
     [echo] args.input=dx\\modified.resolved.variables\\0fb6f50a-50a2-4967-a474-28cfa1f3170c.ditamap
     [echo] args.logdir=log
     [echo] args.rellinks=none
     [echo] args.xml.systemid.set=yes
     [echo] dita.css.dir=V\:\\\\css
     [echo] dita.dir=V\:\\
     [echo] dita.doc.articles.dir=V\:\\\\doc\\articles
     [echo] dita.doc.dir=V\:\\\\doc
     [echo] dita.doc.langref.dir=V\:\\\\doc\\langref-dita1.1
     [echo] dita.dtd.dir=V\:\\\\dtd
     [echo] dita.input.dirname=V\:\\dx\\modified.resolved.variables
     [echo] dita.input.filename=0fb6f50a-50a2-4967-a474-28cfa1f3170c.ditamap
     [echo] dita.map.filename.root=0fb6f50a-50a2-4967-a474-28cfa1f3170c
     [echo] dita.output.dir=V\:\\\\out
     [echo] dita.output.docbook.dir=V\:\\\\out\\docbook
     [echo] dita.plugin.com.sophos.tocjs.dir=V\:\\plugins\\com.sophos.tocjs
     [echo] dita.plugin.org.dita.base.dir=V\:\\
     [echo] dita.plugin.org.dita.docbook.dir=V\:\\plugins\\org.dita.docbook
     [echo] dita.plugin.org.dita.eclipsecontent.dir=V\:\\plugins\\org.dita.eclipsecontent
     [echo] dita.plugin.org.dita.eclipsehelp.dir=V\:\\plugins\\org.dita.eclipsehelp
     [echo] dita.plugin.org.dita.htmlhelp.dir=V\:\\plugins\\org.dita.htmlhelp
     [echo] dita.plugin.org.dita.javahelp.dir=V\:\\plugins\\org.dita.javahelp
     [echo] dita.plugin.org.dita.legacypdf.dir=V\:\\plugins\\legacypdf
     [echo] dita.plugin.org.dita.odt.dir=V\:\\plugins\\org.dita.odt
     [echo] dita.plugin.org.dita.pdf.dir=V\:\\plugins\\org.dita.pdf
     [echo] dita.plugin.org.dita.pdf2.dir=V\:\\plugins\\org.dita.pdf2
     [echo] dita.plugin.org.dita.specialization.dita11.dir=V\:\\plugins\\org.dita.specialization.dita11
     [echo] dita.plugin.org.dita.specialization.dita132.dir=V\:\\plugins\\org.dita.specialization.dita132
     [echo] dita.plugin.org.dita.specialization.eclipsemap.dir=V\:\\plugins\\org.dita.specialization.eclipsemap
     [echo] dita.plugin.org.dita.specialization.h2d.dir=V\:\\plugins\\h2d
     [echo] dita.plugin.org.dita.troff.dir=V\:\\plugins\\org.dita.troff
     [echo] dita.plugin.org.dita.wordrtf.dir=V\:\\plugins\\org.dita.wordrtf
     [echo] dita.plugin.org.dita.xhtml.dir=V\:\\plugins\\org.dita.xhtml
     [echo] dita.preprocess.reloadstylesheet=false
     [echo] dita.resource.dir=V\:\\\\resource
     [echo] dita.samples.dir=V\:\\\\samples
     [echo] dita.temp.dir=temp
     [echo] dita.topic.filename.root=0fb6f50a-50a2-4967-a474-28cfa1f3170c.ditamap
     [echo] preprocess.copy-image.skip=true
     [echo] *****************************************************************

output-css-warn-message:

output-msg:

build-init:

gen-list:
 [gen-list] GenMapAndTopicListModule.execute(): Starting...
 [gen-list] GenMapAndTopicListModule.execute(): Execution time: 71 milliseconds

BUILD FAILED
V:\build_demo.xml:311: The following error occurred while executing this line:
V:\build_demo.xml:400: The following error occurred while executing this line:
V:\build.xml:44: The following error occurred while executing this line:
V:\plugins\org.dita.base\build_preprocess.xml:24: java.lang.NoClassDefFoundError: org/apache/xerces/xni/grammars/XMLGrammarPool
at org.dita.dost.module.GenMapAndTopicListModule.execute(GenMapAndTopicListModule.java:268)
at org.dita.dost.pipeline.PipelineFacade.execute(PipelineFacade.java:64)
at org.dita.dost.invoker.ExtensibleAntInvoker.execute(ExtensibleAntInvoker.java:140)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.xni.grammars.XMLGrammarPool
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 58 more

Total time: 4 seconds

Radu Coravu

unread,
Feb 4, 2016, 6:59:45 AM2/4/16
to nilesh k, DITA-OT Users
Hi,

In the DITA OT "lib" library there are a bunch of JAR libraries (among which the xercesImpl JAR which seems to be missing in your case) which need to be added in the Java class path from the scripts you are using to start everything.

Regards,
Radu

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nilesh k

unread,
Feb 4, 2016, 7:09:04 AM2/4/16
to DITA-OT Users, kodulka...@gmail.com
xercesImpl.jar file is available in lib folder. There is one more xercesImpl-2.7.1.jar file available @dita-ot1.8.5\plugins\org.dita.pdf2\fop\lib.

Not sure whats wrong here.This is how my batch file looks like:

REM This file is part of the DITA Open Toolkit project hosted on
REM Sourceforge.net. See the accompanying license.txt file for
REM applicable licenses.
REM (c) Copyright IBM Corp. 2006 All Rights Reserved.
REM Get the absolute path of DITAOT's home directory
set DITA_DIR=%~dp0
REM Set environment variables
set ANT_OPTS=-Xmx512m %ANT_OPTS%
set ANT_OPTS=%ANT_OPTS% -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
set ANT_HOME=%DITA_DIR%tools\ant
set PATH=%DITA_DIR%tools\ant\bin;%PATH%
set CLASSPATH=%DITA_DIR%lib;%DITA_DIR%lib\dost.jar;%DITA_DIR%lib\commons-codec-1.4.jar;%DITA_DIR%lib\dost.jar;%DITA_DIR%lib\resolver.jar;%DITA_DIR%lib\icu4j.jar;%CLASSPATH%
set CLASSPATH=%DITA_DIR%lib\saxon\saxon9.jar;%DITA_DIR%lib\saxon\saxon9-dom.jar;%CLASSPATH%
set CLASSPATH=%DITA_DIR%lib\saxon\saxon9-dom4j.jar;%DITA_DIR%lib\saxon\saxon9-jdom.jar;%CLASSPATH%
set CLASSPATH=%DITA_DIR%lib\saxon\saxon9-s9api.jar;%DITA_DIR%lib\saxon\saxon9-sql.jar;%CLASSPATH%
set CLASSPATH=%DITA_DIR%lib\saxon\saxon9-xom.jar;%DITA_DIR%lib\saxon\saxon9-xpath.jar;%DITA_DIR%lib\saxon\saxon9-xqj.jar;%CLASSPATH%
set JAVA_HOME=%DITA_DIR%Java\jdk1.7.0_17
IF [%~5]==[] (
tools\ant\bin\ant -f build_demo.xml -Dprompt.output.directory=%~2 -Dprompt.output.type="%~4" -Dprompt.ditamap.filename="%~1" -logfile="%~3" -Dprompt.output.confirm=Y
) ELSE (
IF "%~4"=="pdf" (
tools\ant\bin\ant -f build_demo.xml -Dprompt.output.directory="%~2" -Dprompt.output.type="%~4" -Dprompt.ditamap.filename="%~1" -logfile="%~3" -Dprompt.output.confirm=Y 
) ELSE (
tools\ant\bin\ant -f build_demo.xml -Dprompt.output.directory=%~2 -Dprompt.output.type=%~4 -Dprompt.ditamap.filename=%~1 -logfile %~3 -Dprompt.output.confirm=Y -Dargs.xsl=%~5
)
)

Radu Coravu

unread,
Feb 4, 2016, 7:20:42 AM2/4/16
to nilesh k, DITA-OT Users
I'm just saying that your script's CLASSPATH should also contain links to all those libraries in the DITA OT lib folder (it contains links to some of them but not to the Xerces library).

nilesh k

unread,
Feb 4, 2016, 7:49:09 AM2/4/16
to DITA-OT Users, kodulka...@gmail.com
That was helpful. 
One question: There is no folder called as Saxon in DITA OT 2.2.2. How should i form the above batch file?
Should i keep only CLASSPATH for \lib\*.jar files?

Radu Coravu

unread,
Feb 4, 2016, 7:55:52 AM2/4/16
to nilesh k, DITA-OT Users
I'm not sure that you can use "*" wildcards in classpath entries.
So you should probably add individual references to all necessary JAR libraries.
Reply all
Reply to author
Forward
0 new messages