ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaw, Chris" <Chris.S...@ecb.int>
Subject xslt task fatal error
Date Fri, 14 Jun 2002 08:41:39 GMT
Hi,

I have created an xslt task as follows:
        <xslt basedir="${schema.dir}" destdir="${tmp.dir}" force="true"
                style="../xsl/${ejb.stylesheet}" in="${xml.schema}">
            <param name="project" expression="${name}"/>
            <param name="ejb.package" expression="${ejb.package}"/>
            <param name="output.dir"
expression="${basedir}/${gen.java.dir}/main"/>
        </xslt>  

Basically it runs over an XML Schema and outputs multiple files into a
specified directory.....using org.apache.xalan.xslt.extensions.Redirect

But periodically, randomly and frequently it fails with any of the following
errors...(sometimes it works 100% fine, sometimes it doesn't..and yet the
input file and xsl do not change!!!).

The first error I sometimes get is: 
  [xslt] ....../ejb.xsl:123: Fatal Error! Unknown error in XPath Cause:
java.lang.NullPointerException
At this line is the statement:
                <xsl:when test="$entity.type='UNKNOWN'">
(you would think that maybe the variable is null...but how could it
sometimes be null and sometimes not when nothing else changes!!!)

The second error I sometimes get is:
     [xslt] ....../ejb.xsl:34: Warning!
java.lang.reflect.InvocationTargetException Cause:
java.lang.reflect.InvocationTargetException
At this line is the statement
        <redirect:write file="{$filename}">
(again, sometimes I don't get this error and sometimes I do...without
changing anthing!)

This is driving me crazy. I can run the command repeatedly and usually I get
the errors, but often I do not get the errors.... (when I had the task as a
java command, namely <java classname="org.apache.xalan.xslt.Process"
fork="true" failonerror="true">, then I didn't ever get these errors).

Is this a known problem? or am I doing something wrong in my task?

Here is a stack trace from runnig ant in debug mode (see below)

Thanks in advance

Chris
-=-=

PS - I even upgraded to the latest Ant 1.5 Beta2, but still have the same
problem....

......./build.xml:234: Fatal error during transformation
        at
org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java)
        at org.apache.tools.ant.Task.perform(Task.java)
        at org.apache.tools.ant.Target.execute(Target.java)
        at org.apache.tools.ant.Target.performTasks(Target.java)
        at org.apache.tools.ant.Project.executeTarget(Project.java)
        at org.apache.tools.ant.Project.executeTargets(Project.java)
        at org.apache.tools.ant.Main.runBuild(Main.java)
        at org.apache.tools.ant.Main.start(Main.java)
        at org.apache.tools.ant.Main.main(Main.java)
--- Nested Exception ---
Fatal error during transformation
        at
org.apache.tools.ant.taskdefs.optional.TraXLiaison.fatalError(TraXLiaison.ja
va)
        at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1230)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
642)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1092)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1070)
        at
org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.jav
a)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java)
        at org.apache.tools.ant.Task.perform(Task.java)
        at org.apache.tools.ant.Target.execute(Target.java)
        at org.apache.tools.ant.Target.performTasks(Target.java)
        at org.apache.tools.ant.Project.executeTarget(Project.java)
        at org.apache.tools.ant.Project.executeTargets(Project.java)
        at org.apache.tools.ant.Main.runBuild(Main.java)
        at org.apache.tools.ant.Main.start(Main.java)
        at org.apache.tools.ant.Main.main(Main.java)
--- Nested Exception ---
javax.xml.transform.TransformerException: java.lang.NullPointerException
        at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1230)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
642)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1092)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1070)
        at
org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.jav
a)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java)
        at org.apache.tools.ant.Task.perform(Task.java)
        at org.apache.tools.ant.Target.execute(Target.java)
        at org.apache.tools.ant.Target.performTasks(Target.java)
        at org.apache.tools.ant.Project.executeTarget(Project.java)
        at org.apache.tools.ant.Project.executeTargets(Project.java)
        at org.apache.tools.ant.Main.runBuild(Main.java)
        at org.apache.tools.ant.Main.start(Main.java)
        at org.apache.tools.ant.Main.main(Main.java)
---------
java.lang.NullPointerException
        at org.apache.xpath.objects.XRTreeFrag.xstr(XRTreeFrag.java:255)
        at
org.apache.xpath.objects.XObject.dispatchCharactersEvents(XObject.java:170)
        at
org.apache.xpath.Expression.executeCharsToContentHandler(Expression.java:303
)
        at
org.apache.xalan.templates.ElemValueOf.execute(ElemValueOf.java:319)
        at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2186)
        at
org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:430)
        at
org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:27
9)
        at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2186)
        at
org.apache.xalan.transformer.TransformerImpl.transformToRTF(TransformerImpl.
java:1729)
        at
org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:327)
        at
org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:282)
        at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2186)
        at
org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:430)
        at
org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:27
9)
        at
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.ja
va:438)
        at
org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:299)
        at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApp
lyTemplates.java:420)
        at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.jav
a:226)
        at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2186)
        at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2012)
        at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1175)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
642)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1092)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1070)
        at
org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.jav
a)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java)
        at org.apache.tools.ant.Task.perform(Task.java)
        at org.apache.tools.ant.Target.execute(Target.java)
        at org.apache.tools.ant.Target.performTasks(Target.java)
        at org.apache.tools.ant.Project.executeTarget(Project.java)
        at org.apache.tools.ant.Project.executeTargets(Project.java)
        at org.apache.tools.ant.Main.runBuild(Main.java)
        at org.apache.tools.ant.Main.start(Main.java)
        at org.apache.tools.ant.Main.main(Main.java)


~~~~~~~~~~~~~~~~~~~~
Chris Shaw
> European Central Bank
> DG Information Systems
> * Chris.Shaw@ecb.int
~~~~~~~~~~~~~~~~~~~~


Any e-mail message from the European Central Bank (ECB) is sent in good faith but shall neither
be binding nor construed as constituting a commitment by the ECB except where provided for
in a written agreement.
This e-mail is intended only for the use of the recipient(s) named above. Any unauthorised
disclosure, use or dissemination, either in whole or in part, is prohibited.
If you have received this e-mail in error, please notify the sender immediately via e-mail
and delete this e-mail from your system.


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message