NullPointerException in script

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

NullPointerException in script

Alex Mac
I get a null pointer exception when i try running the following script
on itself, it shouldn't actually do anything so I'm guessing the error
is during the compilation stage.

I'm using saxon-b 8.6 with sun jdk 1.5.0_06-b05

Here is the error:
java.lang.NullPointerException
        at net.sf.saxon.instruct.CopyOf.createsNewNodes(CopyOf.java:59)
        at net.sf.saxon.instruct.Instruction.computeSpecialProperties(Instruction.java:205)
        at net.sf.saxon.expr.ComputedExpression.computeStaticProperties(ComputedExpression.java:285)
        at net.sf.saxon.expr.ComputedExpression.getSpecialProperties(ComputedExpression.java:274)
        at net.sf.saxon.instruct.Choose.createsNewNodes(Choose.java:167)
        at net.sf.saxon.instruct.Instruction.computeSpecialProperties(Instruction.java:205)
        at net.sf.saxon.expr.ComputedExpression.computeStaticProperties(ComputedExpression.java:285)
        at net.sf.saxon.expr.ComputedExpression.getCardinality(ComputedExpression.java:323)
        at net.sf.saxon.expr.TypeChecker.staticTypeCheck(TypeChecker.java:247)
        at net.sf.saxon.style.XSLGeneralVariable.initializeInstruction(XSLGeneralVariable.java:338)
        at net.sf.saxon.style.XSLVariable.compileLocalVariable(XSLVariable.java:145)
        at net.sf.saxon.style.StyleElement.compileSequenceConstructor(StyleElement.java:1384)
        at net.sf.saxon.style.XSLTemplate.compile(XSLTemplate.java:250)
        at net.sf.saxon.style.XSLStylesheet.compileStylesheet(XSLStylesheet.java:1018)
        at net.sf.saxon.PreparedStylesheet.setStylesheetDocument(PreparedStylesheet.java:290)
        at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:117)
        at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:130)
        at net.sf.saxon.Transform.doMain(Transform.java:435)
        at net.sf.saxon.Transform.main(Transform.java:60)
Fatal error during transformation: null


and here is the script:


<?xml version="1.0" encoding="UTF-8" ?>

<xsl:stylesheet version="2.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xs="http://www.w3.org/2001/XMLSchema">

        <xsl:template match="foo">

                <xsl:variable name="bar" as="node()*">
                        <xsl:if test="position()">
                                <xsl:copy-of select="."/>
                        </xsl:if>
                </xsl:variable>
               
                <xsl:copy-of select="$bar"/>
               
        </xsl:template>

</xsl:stylesheet>
N�HY޵隊X���'���u���[�������
ަ�k��!���W�~�鮆�zk��C� 塧m����@^ǚ��^��z�Z�f�z�j�!�x2�������ɫ,��� a{� �,�H��4�m���i�(��ܢo�v'��jYhr'ׯ:�rX��Ʊ�x^����X��X��Ʊ�x^��b��,���y�+��޶m����+-��.�ǟ�����+-��b�ا~��k'��i
Reply | Threaded
Open this post in threaded view
|

RE: NullPointerException in script

Michael Kay
This is a known bug in 8.6 which is fixed in 8.6.1.

Michael Kay
http://www.saxonica.com/

 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of none none
> Sent: 13 December 2005 15:25
> To: [hidden email]
> Subject: [saxon] NullPointerException in script
>
> I get a null pointer exception when i try running the following script
> on itself, it shouldn't actually do anything so I'm guessing the error
> is during the compilation stage.
>
> I'm using saxon-b 8.6 with sun jdk 1.5.0_06-b05
>
> Here is the error:
> java.lang.NullPointerException
>         at
> net.sf.saxon.instruct.CopyOf.createsNewNodes(CopyOf.java:59)
>         at
> net.sf.saxon.instruct.Instruction.computeSpecialProperties(Ins
> truction.java:205)
>         at
> net.sf.saxon.expr.ComputedExpression.computeStaticProperties(C
> omputedExpression.java:285)
>         at
> net.sf.saxon.expr.ComputedExpression.getSpecialProperties(Comp
> utedExpression.java:274)
>         at
> net.sf.saxon.instruct.Choose.createsNewNodes(Choose.java:167)
>         at
> net.sf.saxon.instruct.Instruction.computeSpecialProperties(Ins
> truction.java:205)
>         at
> net.sf.saxon.expr.ComputedExpression.computeStaticProperties(C
> omputedExpression.java:285)
>         at
> net.sf.saxon.expr.ComputedExpression.getCardinality(ComputedEx
> pression.java:323)
>         at
> net.sf.saxon.expr.TypeChecker.staticTypeCheck(TypeChecker.java:247)
>         at
> net.sf.saxon.style.XSLGeneralVariable.initializeInstruction(XS
> LGeneralVariable.java:338)
>         at
> net.sf.saxon.style.XSLVariable.compileLocalVariable(XSLVariabl
> e.java:145)
>         at
> net.sf.saxon.style.StyleElement.compileSequenceConstructor(Sty
> leElement.java:1384)
>         at
> net.sf.saxon.style.XSLTemplate.compile(XSLTemplate.java:250)
>         at
> net.sf.saxon.style.XSLStylesheet.compileStylesheet(XSLStyleshe
> et.java:1018)
>         at
> net.sf.saxon.PreparedStylesheet.setStylesheetDocument(Prepared
> Stylesheet.java:290)
>         at
> net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:117)
>         at
> net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFa
> ctoryImpl.java:130)
>         at net.sf.saxon.Transform.doMain(Transform.java:435)
>         at net.sf.saxon.Transform.main(Transform.java:60)
> Fatal error during transformation: null
>
>
> and here is the script:
>
>
> <?xml version="1.0" encoding="UTF-8" ?>
>
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
> <xsl:template match="foo">
>
> <xsl:variable name="bar" as="node()*">
> <xsl:if test="position()">
> <xsl:copy-of select="."/>
> </xsl:if>
> </xsl:variable>
>
> <xsl:copy-of select="$bar"/>
>
> </xsl:template>
>
> </xsl:stylesheet>
> NHYXu[
> ??W~zk ^o?z?fzjx ?
> { > ,H4i??ovj
>




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: NullPointerException in script

Alex Mac
On 13/12/05, Michael Kay <[hidden email]> wrote:
> This is a known bug in 8.6 which is fixed in 8.6.1.
>
> Michael Kay

Ahh indeed it is. I've upgraded and it works fine, however I have
another script that runs fine normally but crashes when i turn on
tracing with -T

Here is the error:

java.lang.NullPointerException
        at net.sf.saxon.instruct.CopyOf.createsNewNodes(CopyOf.java:59)
        at net.sf.saxon.instruct.Instruction.computeSpecialProperties(Instruction.java:205)
        at net.sf.saxon.expr.ComputedExpression.computeStaticProperties(ComputedExpression.java:285)
        at net.sf.saxon.expr.ComputedExpression.getSpecialProperties(ComputedExpression.java:274)
        at net.sf.saxon.instruct.TraceWrapper.createsNewNodes(TraceWrapper.java:149)
        at net.sf.saxon.instruct.Instruction.computeSpecialProperties(Instruction.java:205)
        at net.sf.saxon.expr.ComputedExpression.computeStaticProperties(ComputedExpression.java:285)
        at net.sf.saxon.expr.ComputedExpression.getSpecialProperties(ComputedExpression.java:274)
        at net.sf.saxon.instruct.Block.createsNewNodes(Block.java:144)
        at net.sf.saxon.instruct.Instruction.computeSpecialProperties(Instruction.java:205)
        at net.sf.saxon.expr.ComputedExpression.computeStaticProperties(ComputedExpression.java:285)
        at net.sf.saxon.expr.ComputedExpression.getDependencies(ComputedExpression.java:346)
        at net.sf.saxon.expr.ComputedExpression.computeDependencies(ComputedExpression.java:363)
        at net.sf.saxon.expr.ComputedExpression.computeStaticProperties(ComputedExpression.java:285)
        at net.sf.saxon.expr.ComputedExpression.getDependencies(ComputedExpression.java:346)
        at net.sf.saxon.instruct.TraceWrapper.getDependencies(TraceWrapper.java:139)
        at net.sf.saxon.expr.ComputedExpression.computeDependencies(ComputedExpression.java:363)
        at net.sf.saxon.expr.ComputedExpression.computeStaticProperties(ComputedExpression.java:285)
        at net.sf.saxon.expr.ComputedExpression.getCardinality(ComputedExpression.java:323)
        at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:56)
        at net.sf.saxon.instruct.TraceWrapper.typeCheck(TraceWrapper.java:39)
        at net.sf.saxon.instruct.TraceWrapper.typeCheck(TraceWrapper.java:39)
        at net.sf.saxon.style.XSLTemplate.compile(XSLTemplate.java:304)
        at net.sf.saxon.style.XSLStylesheet.compileStylesheet(XSLStylesheet.java:1018)
        at net.sf.saxon.PreparedStylesheet.setStylesheetDocument(PreparedStylesheet.java:290)
        at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:117)
        at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:130)
        at net.sf.saxon.Transform.doMain(Transform.java:435)
        at net.sf.saxon.Transform.main(Transform.java:60)
Fatal error during transformation: null

And here is the script:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="*">
                <xsl:variable name="foo" as="node()*">
                        <xsl:copy>
                                <xsl:copy-of select="@*"/>
                                <xsl:apply-templates/>
                        </xsl:copy>
                </xsl:variable>
                <xsl:value-of select="$foo"/>
        </xsl:template>
</xsl:stylesheet>
N�HY޵隊X���'���u���[�������
ަ�k��!���W�~�鮆�zk��C� 塧m����@^ǚ��^��z�Z�f�z�j�!�x2�������ɫ,��� a{� �,�H��4�m���i�(��ܢo�v'��jYhr'ׯ:�rX��Ʊ�x^����X��X��Ʊ�x^��b��,���y�+��޶m����+-��.�ǟ�����+-��b�ا~��k'��i
Reply | Threaded
Open this post in threaded view
|

RE: NullPointerException in script

Michael Kay
Thanks, yes: it's also known that the bug still exists in 8.6.1 when a
TraceListener is in use.

See
http://sourceforge.net/tracker/index.php?func=detail&aid=1369624&group_id=29
872&atid=397617

for patch and circumvention.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of none none
> Sent: 14 December 2005 15:16
> To: [hidden email]
> Subject: Re: [saxon] NullPointerException in script
>
> On 13/12/05, Michael Kay <[hidden email]> wrote:
> > This is a known bug in 8.6 which is fixed in 8.6.1.
> >
> > Michael Kay
>
> Ahh indeed it is. I've upgraded and it works fine, however I have
> another script that runs fine normally but crashes when i turn on
> tracing with -T
>
> Here is the error:
>
> java.lang.NullPointerException
>         at
> net.sf.saxon.instruct.CopyOf.createsNewNodes(CopyOf.java:59)
>         at
> net.sf.saxon.instruct.Instruction.computeSpecialProperties(Ins
> truction.java:205)
>         at
> net.sf.saxon.expr.ComputedExpression.computeStaticProperties(C
> omputedExpression.java:285)
>         at
> net.sf.saxon.expr.ComputedExpression.getSpecialProperties(Comp
> utedExpression.java:274)
>         at
> net.sf.saxon.instruct.TraceWrapper.createsNewNodes(TraceWrappe
> r.java:149)
>         at
> net.sf.saxon.instruct.Instruction.computeSpecialProperties(Ins
> truction.java:205)
>         at
> net.sf.saxon.expr.ComputedExpression.computeStaticProperties(C
> omputedExpression.java:285)
>         at
> net.sf.saxon.expr.ComputedExpression.getSpecialProperties(Comp
> utedExpression.java:274)
>         at net.sf.saxon.instruct.Block.createsNewNodes(Block.java:144)
>         at
> net.sf.saxon.instruct.Instruction.computeSpecialProperties(Ins
> truction.java:205)
>         at
> net.sf.saxon.expr.ComputedExpression.computeStaticProperties(C
> omputedExpression.java:285)
>         at
> net.sf.saxon.expr.ComputedExpression.getDependencies(ComputedE
> xpression.java:346)
>         at
> net.sf.saxon.expr.ComputedExpression.computeDependencies(Compu
> tedExpression.java:363)
>         at
> net.sf.saxon.expr.ComputedExpression.computeStaticProperties(C
> omputedExpression.java:285)
>         at
> net.sf.saxon.expr.ComputedExpression.getDependencies(ComputedE
> xpression.java:346)
>         at
> net.sf.saxon.instruct.TraceWrapper.getDependencies(TraceWrappe
> r.java:139)
>         at
> net.sf.saxon.expr.ComputedExpression.computeDependencies(Compu
> tedExpression.java:363)
>         at
> net.sf.saxon.expr.ComputedExpression.computeStaticProperties(C
> omputedExpression.java:285)
>         at
> net.sf.saxon.expr.ComputedExpression.getCardinality(ComputedEx
> pression.java:323)
>         at
> net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:56)
>         at
> net.sf.saxon.instruct.TraceWrapper.typeCheck(TraceWrapper.java:39)
>         at
> net.sf.saxon.instruct.TraceWrapper.typeCheck(TraceWrapper.java:39)
>         at
> net.sf.saxon.style.XSLTemplate.compile(XSLTemplate.java:304)
>         at
> net.sf.saxon.style.XSLStylesheet.compileStylesheet(XSLStyleshe
> et.java:1018)
>         at
> net.sf.saxon.PreparedStylesheet.setStylesheetDocument(Prepared
> Stylesheet.java:290)
>         at
> net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:117)
>         at
> net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFa
> ctoryImpl.java:130)
>         at net.sf.saxon.Transform.doMain(Transform.java:435)
>         at net.sf.saxon.Transform.main(Transform.java:60)
> Fatal error during transformation: null
>
> And here is the script:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="*">
> <xsl:variable name="foo" as="node()*">
> <xsl:copy>
> <xsl:copy-of select="@*"/>
> <xsl:apply-templates/>
> </xsl:copy>
> </xsl:variable>
> <xsl:value-of select="$foo"/>
> </xsl:template>
> </xsl:stylesheet>
> NHYXu[
> ??W~zk ^o?z?fzjx ?
> { > ,H4i??ovj
>




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: NullPointerException in script

Alex Mac
On 14/12/05, Michael Kay <[hidden email]> wrote:
> Thanks, yes: it's also known that the bug still exists in 8.6.1 when a
> TraceListener is in use.

Ok, I'll check that in future instead of bothering you with problems
that have already been fixed :)
N�HY޵隊X���'���u���[�������
ަ�k��!���W�~�鮆�zk��C� 塧m����@^ǚ��^��z�Z�f�z�j�!�x2�������ɫ,��� a{� �,�H��4�m���i�(��ܢo�v'��jYhr'ׯ:�rX��Ʊ�x^����X��X��Ʊ�x^��b��,���y�+��޶m����+-��.�ǟ�����+-��b�ا~��k'��i