antdoc task getting javax.xml.transform.TransformerException

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

antdoc task getting javax.xml.transform.TransformerException

Oğuz Dağ
I am using Hudson 1.144 in RedHat EL3... But I have encountered with a strange error..

I have an ant job that includes some defined task in it (AntDoc),  I can successfully run this ant script from command line (ant -f ....) , but whenever I tried to run from Hudson (as a job), I am getting some errors...

Here is my ant script (I mean without project tags)

                <taskdef name="AntDoc" classname="org.ed.pack.ant.AntDoc"/>
                <target name="DocumentAntScript”> 
                              <AntDoc destination="antdoc" buildfile="build_beta_compile_svn.xml"/>
                </target>

And here is the error I am getting from console view of hudson...

DocumentAntScript:
   [AntDoc] AntDoc running...
   [AntDoc] Ant script file '/home/aurora/REL_MAN/PRODUCTION_BASELINE/build_beta_compile_svn.xml' is concerned
   [AntDoc] Using XSLT TransformerFactory implementation 'com.icl.saxon.TransformerFactoryImpl'
   [AntDoc] Using XSL style sheet 'AntDoc1.1.xsl'
   [AntDoc] Now, transforming the Ant buildfiles into HTML...
   [AntDoc] Error at xsl:choose on line 603 of file://home/server/.hudson/jobs/Documentation/workspace/:
   [AntDoc]   javax.xml.transform.TransformerException: java.net.UnknownHostException: home: java.net.UnknownHostException: home: home
   [AntDoc] Internal AntDoc error while creating documentation: could not transform properly
   [AntDoc] ; SystemID: file://home/server/.hudson/jobs/Documentation/workspace/; Line#: 603; Column#: -1
   [AntDoc] javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: java.net.UnknownHostException: home
   [AntDoc]    at com.icl.saxon.style.StyleElement.styleError(StyleElement.java:800)
   [AntDoc]    at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:629)
   [AntDoc]    at com.icl.saxon.style.XSLTemplate.realExpand(XSLTemplate.java:195)
   [AntDoc]    at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:187)
   [AntDoc]    at com.icl.saxon.style.XSLCallTemplate.process(XSLCallTemplate.java:177)
   [AntDoc]    at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:627)
   [AntDoc]    at com.icl.saxon.style.XSLTemplate.realExpand(XSLTemplate.java:195)
   [AntDoc]    at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:187)
   [AntDoc]    at com.icl.saxon.style.XSLCallTemplate.process(XSLCallTemplate.java:177)
   [AntDoc]    at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:627)
 

 
I am using some older version of Saxon (I am using 6.2.2, currently they have 8.0.9) to successfully use AntDoc. Otherwise it won't work.. Can you help me to solve it?

If you need, I can send you a full stack trace

Reply | Threaded
Open this post in threaded view
|

Re: antdoc task getting javax.xml.transform.TransformerException

Jesse Glick
oguzdag wrote:
> file://home/server/.hudson/jobs/Documentation/workspace/

This URL is bogus. Probably you meant

file:/home/server/.hudson/jobs/Documentation/workspace/

Probably some piece of code (I have no idea where - Hudson, Ant, your
custom code...) misguidedly tried to create a URL by using

File path;
String uri = "file:/" + path; // WRONG

Use:

String uri = path.toURI().toString();

Also do not use File.toURL(), it is broken.

-J.

--
[hidden email]  netbeans.org  ant.apache.org  hudson.dev.java.net
             http://google.com/search?q=e%5E%28pi*i%29%2B1

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: antdoc task getting javax.xml.transform.TransformerException

Oğuz Dağ
Jesse Glick wrote
oguzdag wrote:
> file://home/server/.hudson/jobs/Documentation/workspace/

This URL is bogus. Probably you meant

file:/home/server/.hudson/jobs/Documentation/workspace/

Probably some piece of code (I have no idea where - Hudson, Ant, your
custom code...) misguidedly tried to create a URL by using

File path;
String uri = "file:/" + path; // WRONG

Use:

String uri = path.toURI().toString();

Also do not use File.toURL(), it is broken.
I am not giving any path in anywhere, it is automatically created by Hudson (I think)...

Anyway, when I read your reply, I decided to try to give full path to create antdoc destination instead of relative (I thought maybe it tries to create relative folder under "workspace", and maybe the problem is this)... I did, but I saw that absolute folder created for destination, index.html is also created, but then something went wrong... It gave that error again...

Then I thought maybe something wrong with my ant script to document (it's given as buildfile), I changed it to a very simple one, but no, again I took the same error...

As I said when I tried to run that script without hudson, there is no error.

Is there any configuration that I forgot to make to use some saxon libraries.. Because again as I said, it's older than current...
Reply | Threaded
Open this post in threaded view
|

Re: antdoc task getting javax.xml.transform.TransformerException

Oğuz Dağ
I couldn't figure out, so I am giving up using antdoc (anyway, it was optional, I have to find another way to document my ant script)
Reply | Threaded
Open this post in threaded view
|

Re: antdoc task getting javax.xml.transform.TransformerException

Kohsuke Kawaguchi
Administrator
In reply to this post by Oğuz Dağ

You are doing this from Ant that's invoked by Hudson, right?

I doubt if Hudson has anything to do with this issue. The only thing
Hudson passes to Ant is the command line arguments that you specified,
and I don't think that includes any wrong file URL.

When you say you run this outside Hudson, are you sure the environments
are the same? For example, often the user account that Hudson runs and
you run are different, and those could make a lot of difference in
program behavior --- everything from PATH to JDK versions.




Oğuz Dağ wrote:

>
> Jesse Glick wrote:
>>
>> oguzdag wrote:
>>> file://home/server/.hudson/jobs/Documentation/workspace/
>>
>> This URL is bogus. Probably you meant
>>
>> file:/home/server/.hudson/jobs/Documentation/workspace/
>>
>> Probably some piece of code (I have no idea where - Hudson, Ant, your
>> custom code...) misguidedly tried to create a URL by using
>>
>> File path;
>> String uri = "file:/" + path; // WRONG
>>
>> Use:
>>
>> String uri = path.toURI().toString();
>>
>> Also do not use File.toURL(), it is broken.
>>
>>
>>
>
> I am not giving any path in anywhere, it is automatically created by Hudson
> (I think)...
>
> Anyway, when I read your reply, I decided to try to give full path to create
> antdoc destination instead of relative (I thought maybe it tries to create
> relative folder under "workspace", and maybe the problem is this)... I did,
> but I saw that absolute folder created for destination, index.html is also
> created, but then something went wrong... It gave that error again...
>
> Then I thought maybe something wrong with my ant script to document (it's
> given as buildfile), I changed it to a very simple one, but no, again I took
> the same error...
>
> As I said when I tried to run that script without hudson, there is no error.
>
> Is there any configuration that I forgot to make to use some saxon
> libraries.. Because again as I said, it's older than current...

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: antdoc task getting javax.xml.transform.TransformerException

Oğuz Dağ
kohsuke wrote
You are doing this from Ant that's invoked by Hudson, right?

I doubt if Hudson has anything to do with this issue. The only thing
Hudson passes to Ant is the command line arguments that you specified,
and I don't think that includes any wrong file URL.

When you say you run this outside Hudson, are you sure the environments
are the same? For example, often the user account that Hudson runs and
you run are different, and those could make a lot of difference in
program behavior --- everything from PATH to JDK versions.
Yes that's a job that invokes an ant script...

And you are right, I am running Hudson in different user than I run it manually.. When I go work, I will try to run Ant script by the Hudson account, and post the results here...

Thank you...
Reply | Threaded
Open this post in threaded view
|

Re: antdoc task getting javax.xml.transform.TransformerException

Oğuz Dağ

Oğuz Dağ wrote
kohsuke wrote
You are doing this from Ant that's invoked by Hudson, right?

I doubt if Hudson has anything to do with this issue. The only thing
Hudson passes to Ant is the command line arguments that you specified,
and I don't think that includes any wrong file URL.

When you say you run this outside Hudson, are you sure the environments
are the same? For example, often the user account that Hudson runs and
you run are different, and those could make a lot of difference in
program behavior --- everything from PATH to JDK versions.
Yes that's a job that invokes an ant script...

And you are right, I am running Hudson in different user than I run it manually.. When I go work, I will try to run Ant script by the Hudson account, and post the results here...

Thank you...
Thanks kohsuke a lot,

I solved the case, even if I couldn't figure out why..

So that, the account which Hudson is running and the account which I run script manually has different ANT INSTALLATION. I saw before but didn't care because they are same version ANTs.  Obviously, it is very deceiver, so I changed ANT in Hudson configuration to correct ANT, it went ok...

Then I thought even if ant versions are same (1.6.5), but maybe it differs in library ( I may have changed in order to fix something) .. So I equalized both Ant versions to correct one. Now, everything is fine..

I'll dig into the problem later... If I find something helpful, I'll share it in here...
Reply | Threaded
Open this post in threaded view
|

Re: antdoc task getting javax.xml.transform.TransformerException

Kohsuke Kawaguchi
Administrator
Oğuz Dağ wrote:

> I solved the case, even if I couldn't figure out why..
>
> So that, the account which Hudson is running and the account which I run
> script manually has different ANT INSTALLATION. I saw before but didn't care
> because they are same version ANTs.  Obviously, it is very deceiver, so I
> changed ANT in Hudson configuration to correct ANT, it went ok...
>
> Then I thought even if ant versions are same (1.6.5), but maybe it differs
> in library ( I may have changed in order to fix something) .. So I equalized
> both Ant versions to correct one. Now, everything is fine..
>
> I'll dig into the problem later... If I find something helpful, I'll share
> it in here...
Thanks for the update.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]


smime.p7s (4K) Download Attachment