RE: Trouble configuring custom extension in xmlcalabash

Thanks Romain.

I was reluctant to try it that way, as I was expecting I would have to add all dependent libs of calabash on the classpath as well, but that doesn’t seem necessary. ☺

I also tried replacing –cp with –Xbootstrap/a: but then it runs until the extension and throws the exception that it couldn’t find calabash classes being referenced from the extension. Adding calabash to the bootstrap search path as well, made things worse: it can’t find the calabash dependencies any more (like saxon, quite necessary). Apparently the class-path setting within the calabash.jar is respected when loading it with –cp, but not when loading it with bootstrap.. :P

So I will stick to loading calabash through –cp and call the Main class, instead of using –jar..

Kind regards,

Van: Romain Deltour []
Verzonden: donderdag 21 juli 2011 8:55
Aan: Geert Josten; XProc Dev (
Onderwerp: Re: Trouble configuring custom extension in xmlcalabash

From the Java command line launcher doc:

When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored.


Le 21 juil. 11 à 08:49, Romain Deltour a écrit :

You're right, it seems that your configuration is fine, but that the "only" issue is that the class cannot be found.

Can you try:

java -cp lib\grtjn-xproc-utils.jar:lib\calabash.jar -Dcom.xmlcalabash.phonehome=false com.xmlcalabash.drivers.Main -c lib/configuration.xml -i source=%INPUTFILE% src\nl\grtjn\xproc\ebook\main.xpl

I'm really not sure, but could it be that the Java "cp" option is not used when trying to execute a Jar (instead of a main class) ?


Le 21 juil. 11 à 08:12, Geert Josten a écrit :

Hi Alex,

Thanks for your time!

You are right, I didn’t edit extension-library.xml within calabash.jar, but I did declare the step in a library of my own which I thought would suffice. Doesn’t it? It essentially comes down to this:

<p:library version="1.0"

               <p:declare-step type="ut:env">
                              <p:output port="result"/>


I also didn’t edit the configuration.xml within calabash.jar, but provided my own one on the command-line, containing this:

<xproc-config xmlns=""

<implementation type="ut:env"


These two bits don’t seem to be the problem, though. I can use <ut:env/> within my pipes, and it knows it should look for the class nl.grtjn.xproc.util.osutils.Env. And I am certain it is added properly to my own jar, as when I use the same jar command to add it to calabash.jar it all works. It just doesn’t work when I have the class in a separate jar and pass it to java as follows:

java -cp lib\grtjn-xproc-utils.jar -Dcom.xmlcalabash.phonehome=false -jar lib\calabash.jar -D -c lib/configuration.xml -i source=%INPUTFILE% src\nl\grtjn\xproc\ebook\main.xpl

I would rather not rely on a patched or self-compiled calabash. I would prefer just providing a separate jar and config to make it work. Am I overlooking something obvious?

Kind regards,

Van:<> [] Namens Alex Muir
Verzonden: donderdag 21 juli 2011 1:24
Aan: Geert Josten
CC: XProc Dev (<>)
Onderwerp: Re: Trouble configuring custom extension in xmlcalabash

Well you didn't mention editing extension-library.xml

Given a new step created I edited 2 files like follows

1. extension-library.xml

<p:declare-step type="mh:StoreAsText" version="1.0">
    <p:input port="source"/>
    <p:output port="result" primary="false"/>
    <p:option name="href" required="true" cx:type="xsd:anyURI"/>
    <p:option name="version" select="'1.0'" cx:type="xsd:string"/>

 2. configuration.xml

<implementation type="mh:StoreAsText"

Alex Muir
Instructor | Program Organizer - University Technology Student Work Experience Building
University of the Gambia<>

Low budget software development benefiting development in the Gambia, West Africa
Experience of a lifetime, come to Gambia and Join UTSWEB -<>

Received on Thursday, 21 July 2011 07:06:24 UTC