NPE in VariableReference.evaluateVariable
Added by Anonymous over 17 years ago
Legacy ID: #4358566 Legacy Poster: Mark Baier (bartmark)
Hello, following NPE occurs. java.lang.NullPointerException at net.sf.saxon.expr.VariableReference.evaluateVariable(VariableReference.java:319) at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:275) at net.sf.saxon.expr.FirstItemExpression.evaluateItem(FirstItemExpression.java:87) at net.sf.saxon.expr.CastExpression.evaluateItem(CastExpression.java:278) at net.sf.saxon.instruct.SimpleNodeConstructor.expandChildren(SimpleNodeConstructor.java:150) at net.sf.saxon.instruct.FixedAttribute.processLeavingTail(FixedAttribute.java:247) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365) at net.sf.saxon.instruct.Instruction.process(Instruction.java:91) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:240) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365) at net.sf.saxon.instruct.Instruction.process(Instruction.java:91) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:240) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365) at net.sf.saxon.instruct.Instruction.process(Instruction.java:91) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:240) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365) at net.sf.saxon.instruct.Template.expand(Template.java:112) at net.sf.saxon.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:375) at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:214) at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:237) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365) at net.sf.saxon.instruct.Template.expand(Template.java:112) at net.sf.saxon.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:375) at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:214) at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:237) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365) at net.sf.saxon.instruct.Instruction.process(Instruction.java:91) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:240) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365) at net.sf.saxon.instruct.Instruction.process(Instruction.java:91) at net.sf.saxon.expr.LetExpression.process(LetExpression.java:268) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:240) at net.sf.saxon.instruct.Template.expand(Template.java:112) at net.sf.saxon.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:375) at net.sf.saxon.Controller.transformDocument(Controller.java:1710) at net.sf.saxon.Controller.transform(Controller.java:1513) at com.solyp.taglibs.xml.TransformTag.doEndTag(TransformTag.java:276) at org.apache.jsp.viewContentEdit_jsp._jspService(viewContentEdit_jsp.java:180) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:391) at org.apache.jsp.collectContentUpdateData_jsp._jspService(collectContentUpdateData_jsp.java:1226) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:391) at org.apache.jsp.showContentMetaEdit_jsp._jspx_meth_c_when_3(showContentMetaEdit_jsp.java:288) at org.apache.jsp.showContentMetaEdit_jsp._jspx_meth_c_choose_0(showContentMetaEdit_jsp.java:185) at org.apache.jsp.showContentMetaEdit_jsp._jspService(showContentMetaEdit_jsp.java:98) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:391) at org.apache.jsp.showDispatcher_jsp._jspx_meth_c_when_64(showDispatcher_jsp.java:2026) at org.apache.jsp.showDispatcher_jsp._jspService(showDispatcher_jsp.java:223) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:391) at org.apache.jsp.localShow_jsp._jspService(localShow_jsp.java:186) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:391) at org.apache.jsp.show_jsp._jspService(show_jsp.java:68) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146) at com.solyp.spf.filter.fix.oc4j.Oc4jBugfixFilter.doFilter(Oc4jBugfixFilter.java:49) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:199) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2350) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) I'm importing another stylesheet which only declares a variable. This imported variable i have assigned to a local variable. The local variable i want to use in following html output <input type="hidden" name="docId" value="{$selectedDocId}" /> If i'm using directly the imported variable no exception occurs. Best regards, Mark
Replies (4)
Please register to reply
RE: NPE in VariableReference.evaluateVariable - Added by Anonymous over 17 years ago
Legacy ID: #4358576 Legacy Poster: Mark Baier (bartmark)
Sorry forgot to mention that i'm using latest Saxon version 8.9.0.3
RE: NPE in VariableReference.evaluateVariable - Added by Anonymous over 17 years ago
Legacy ID: #4358596 Legacy Poster: Michael Kay (mhkay)
Thanks for reporting it. It's not a known bug, though I've seen problems in this area in previous releases. It's almost certainly the result of an incorrect optimization rewrite, one that tried to inline the local variable reference. Could you please supply the stylesheet (and preferably a source document for testing). Michael Kay Saxonica Limited
RE: NPE in VariableReference.evaluateVariable - Added by Anonymous over 17 years ago
Legacy ID: #4358608 Legacy Poster: Mark Baier (bartmark)
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:cur="http://contentEditContent.xsl" exclude-result-prefixes="cur" version="1.0" > <xsl:import href="../variable/documentIdSelectedDocument.xsl" /> <xsl:template name="cur:contentEditContent"> <xsl:variable name="selectedDocId" select="$gspvar:documentIdSelectedDocument" /> <form id="contentEditData" name="contentEditData" method="post" enctype="multipart/form-data"> <input type="hidden" name="docId" value="{$selectedDocId}" /> I think here occurs the exception due to debugging and catching the NPE </form> </xsl:template> </xsl:stylesheet> The imported stylesheet looks like this <xsl:variable name="gspvar:documentIdSelectedDocument" select="string(/page/arguments/selectedDocument/@documentId)" /> Sorry, but more information or source document is not possible Best regards, Mark
RE: NPE in VariableReference.evaluateVariable - Added by Anonymous over 17 years ago
Legacy ID: #4359388 Legacy Poster: Michael Kay (mhkay)
I'm sorry, but I haven't been able to reproduce the problem from the information supplied. The code you've provided is incomplete, for example the namespace gspvar is undeclared. I've tried to fill in the gaps, but the stylesheet I've produced works perfectly. A bug like this can be very sensitive to details that might not appear relevant. I'd be grateful if you could try to produce a complete working repro that demonstrates the problem.
Please register to reply