DO NOT REPLY [Bug 43632] New: - NullPointerException in x:transform

[email protected]
Newsgroups gmane.comp.jakarta.taglibs.devel
Message-ID <[email protected]/bugzilla/>
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43632>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43632

           Summary: NullPointerException in x:transform
           Product: Taglibs
           Version: unspecified
          Platform: Sun
        OS/Version: SunOS
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Standard Taglib
        AssignedTo: [email protected]
        ReportedBy: [email protected]


I may have discovered a bug in jakarta-taglibs-standard-1.1.2.

The JSP code

<x:transform doc="${onlineevents_archiveDoc}"
xslt="${onlineevents_archiveXSLT}">
<x:param name="order" value="${order}" />
</x:transform>

is very occasionally causing a NullPointerException, with the
following stack trace:

java.lang.NullPointerException
***
org.apache.taglibs.standard.tag.common.xml.TransformSupport.addParameter(TransformSupport.java:221)
***
org.apache.taglibs.standard.tag.common.xml.ParamSupport.doEndTag(ParamSupport.java:74)
***
org.apache.jsp.onlineevents.archive.default_jsp._jspx_meth_x_param_0(default_jsp.java:546)
***
org.apache.jsp.onlineevents.archive.default_jsp._jspx_meth_x_transform_0(default_jsp.java:515)
***
org.apache.jsp.onlineevents.archive.default_jsp._jspService(default_jsp.java:206)
*** org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
*** javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
*** org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
*** org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
*** org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
*** javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
***
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
***
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
***
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
***
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
*** org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
***
org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve.java:346)
*** org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
***
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
*** org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
*** org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:425)
***
org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:452)
*** org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
*** java.lang.Thread.run(Thread.java:595)

Looking at the source of TransformSupport, I see the offending method is:

   public void addParameter(String name, Object value) {
       t.setParameter(name, value);
   }

implying that instance variable 't' (of type
javax.xml.transform.Transformer) is set to null - which suggests some
kind of weird bug where it is either overwritten or not initialised
properly.

I'm a bit stuck as I can't reproduce this myself; it seems to be
occurring at random several times a day on my production site.

I had thought it was a concurrency issue and have tried wrapping the
call to <x:transform> in a synchronized block, just in case, but it
hasn't made any noticeable difference.

The server information is:
Tomcat 5.5.17
JVM: Sun 1.5.0_07-b03
OS: SunOS 5.9
Arch: sparc

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.