You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by fa...@epost.de on 2002/12/01 15:48:35 UTC

NullPointerException in translet

Hi!

It's my first attempt to compile a XSLT stylesheet to a translet. My
project consists of two XSLT stylesheets which both work fine when used
in conjunction with Xalan-j 2.4.1 from the command line. Now I compiled
both of them as translets and tried an invocation from a small Java
program. Compiling the translets and the Java app worked fine.
Transformations with one smaller translet works fine. The second
translet, a much larger one (about 80 match templates and some 20 name
templates), gives a NullPointerException. Here is the stack trace:

java.lang.NullPointerException
           at com.dosco.wiview.translets.Document.template$dot$1()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.template$dot$24()
           at com.dosco.wiview.translets.Document.applyTemplates3()
           at com.dosco.wiview.translets.Document.template$dot$23()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.template$dot$22()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.template$dot$20()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.template$dot$19()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.template$dot$46()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.template$dot$46()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.template$dot$46()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.template$dot$45()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.template$dot$31()
           at com.dosco.wiview.translets.Document.applyTemplates()
           at com.dosco.wiview.translets.Document.transform()
           at
org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTra
nslet.java:497)
           at com.dosco.wiview.Transform.doTransform(Transform.java:195)
           at com.dosco.wiview.Transform.main(Transform.java:293)
Translet error(s): null

How do I "debug" this? Is there a way to say what's wrong with the
stylesheet, or the program (or XSLTC)? Can I deduce the template for
which this exception happens?

Hope anybody has a suggestion for me. Thanks in advance.

Franz



Re: NullPointerException in translet

Posted by Santiago Pericas-Geertsen <Sa...@sun.com>.
Franz:
 
 You can try to debug the stylesheet using xsl:message (same as using 
println()). The stack trace would be more useful if you name your templates 
--the names you choose will show up in the trace. 

 In any case, an NPE in the translet is typically a problem in XSLTC. So, 
your best course of action is to try to simplify the stylesheet as much as 
you can and then submit a bug report here:

 http://nagoya.apache.org/bugzilla/index.html

 Please attach an XML too. Thanks.

-- Santiago

On Sunday 01 December 2002 09:48, fackel@epost.de wrote:
> Hi!
>
> It's my first attempt to compile a XSLT stylesheet to a translet. My
> project consists of two XSLT stylesheets which both work fine when used
> in conjunction with Xalan-j 2.4.1 from the command line. Now I compiled
> both of them as translets and tried an invocation from a small Java
> program. Compiling the translets and the Java app worked fine.
> Transformations with one smaller translet works fine. The second
> translet, a much larger one (about 80 match templates and some 20 name
> templates), gives a NullPointerException. Here is the stack trace:
>
> java.lang.NullPointerException
>            at com.dosco.wiview.translets.Document.template$dot$1()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.template$dot$24()
>            at com.dosco.wiview.translets.Document.applyTemplates3()
>            at com.dosco.wiview.translets.Document.template$dot$23()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.template$dot$22()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.template$dot$20()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.template$dot$19()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.template$dot$46()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.template$dot$46()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.template$dot$46()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.template$dot$45()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.template$dot$31()
>            at com.dosco.wiview.translets.Document.applyTemplates()
>            at com.dosco.wiview.translets.Document.transform()
>            at
> org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTra
> nslet.java:497)
>            at com.dosco.wiview.Transform.doTransform(Transform.java:195)
>            at com.dosco.wiview.Transform.main(Transform.java:293)
> Translet error(s): null
>
> How do I "debug" this? Is there a way to say what's wrong with the
> stylesheet, or the program (or XSLTC)? Can I deduce the template for
> which this exception happens?
>
> Hope anybody has a suggestion for me. Thanks in advance.
>
> Franz