You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Olivier Prouvost <ol...@anyware-tech.com> on 2001/03/08 15:46:40 UTC
Pb when calling the java task with a long line of arguments ?
Hi
I try to call xalan directly with the java task. (I know, I should use
the style task, but I need to call xalan1 or xalan2)...
Here is my taks :
<java fork="true" classpath="${myClasspath}" classname="${xalanClass}">
<arg line="-TT -OUT ${OUT} -IN ${IN} -XSL
file://${wrapideXsl}/${XSL} ${PARAM}"/>
</java>
In verbose mode, ant write this :
[java] Forking java -classpath ... org.apache.xalan.xslt.Process -TT
-OUT /home/olivier/GestionProjet.aad -IN
file:///home/olivier/GestionProjet.asd
-XSL file:///home/olivier/xslt/asd2aad.xsl -PARAM entity GestionProjet
But it does not work ! Whereas the generated command works well !!
(if I copy the generated command and execute it it works...)....
Is there a limitation for the line argument ? or a special encoding
generated ???
Thanks.
--
--------------------------------------------
Olivier Prouvost Anyware Technologies
Tel : 05 61 00 52 90 Fax : 05 61 00 51 46
Web : http://www.anyware-tech.com
--------------------------------------------
Ok I found it !!
Posted by Olivier Prouvost <ol...@anyware-tech.com>.
Historically, my build file was wroking in the current directory
... basedir = '.'
Now, I use it from a static place, and I had to compute all the absolute
locations for my files... This is the reason why my parameter line was so
long... I gave the full path for IN and OUT parameters...
By setting the basedir parameter to my current directory, I don't need to
compute all my absolute paths... And my arg line is shorter... and it
works !!
In fact, it was, may be, a pbme with all the '/' in the line ? or may be
my absolutes paths were concat with the current basedir ?
I don't know...
Thanks for your help.
--
--------------------------------------------
Olivier Prouvost Anyware Technologies
Tel : 05 61 00 52 90 Fax : 05 61 00 51 46
Web : http://www.anyware-tech.com
--------------------------------------------
Re: Pb when calling the java task with a long line of arguments ?
Posted by Olivier Prouvost <ol...@anyware-tech.com>.
Stefan Bodewig a écrit :
Nope. Not using fork should be the same except for CLASSPATH and
System.exit issues - and it doesn't involve a shell invocation where I
expect it to fail.
My Pbme is to call xalan1 or xalan2 according to some targets (in fact it
seems to be lots of differences between these 2 versions)... So I really
need to manage my own classpath when using xalan.
> Which JDK and OS are you using?
java version "1.2.2"
Classic VM (build 1.2.2_006, green threads, nojit)
I work on Linux system (mandrake 7.02).
--
--------------------------------------------
Olivier Prouvost Anyware Technologies
Tel : 05 61 00 52 90 Fax : 05 61 00 51 46
Web : http://www.anyware-tech.com
--------------------------------------------
Re: Pb when calling the java task with a long line of arguments ?
Posted by Stefan Bodewig <bo...@apache.org>.
Olivier Prouvost <ol...@anyware-tech.com> wrote:
> In fact, I think that the parameters that are defined in the arg
> element are passed to the java process and not to the class I call ?
> Is'nt it ?
Nope. Not using fork should be the same except for CLASSPATH and
System.exit issues - and it doesn't involve a shell invocation where I
expect it to fail.
Which JDK and OS are you using?
Stefan
Re: Pb when calling the java task with a long line of arguments ?
Posted by Olivier Prouvost <ol...@anyware-tech.com>.
When I remove the fork attribute, I have the following error :
XSLT Error (javax.xml.transform.TransformerConfigurationException):
System property org.xml.sax.driver not specified
which is probably a pbme of classpath...
And I think, I need to set fork to true, because xalan seems to do a
System.exit which stop all processes of the current jvm !
In fact, I think that the parameters that are defined in the arg element
are passed to the java process and not to the class I call ? Is'nt it ?
--
--------------------------------------------
Olivier Prouvost Anyware Technologies
Tel : 05 61 00 52 90 Fax : 05 61 00 51 46
Web : http://www.anyware-tech.com
--------------------------------------------
Re: Pb when calling the java task with a long line of arguments ?
Posted by Stefan Bodewig <bo...@apache.org>.
Olivier Prouvost <ol...@anyware-tech.com> wrote:
> Is there a limitation for the line argument ?
Could be, as most OSs and/or shells impose a limit on command line
lengths. Can you get away without forking?
Stefan