You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Sc...@lotus.com on 2000/03/15 05:56:02 UTC

Re: [Bug 47] New - Xalan throws exceptions in a multithreaded environment with 'xsl:number'

Big thanks for finding and reporting this bug.  If you're ever in Boston I
owe you a beer or a dinner or something.

The bug is fixed in the latest ElemNumber.java and CountersTable.java.  The
creation of the default match pattern for the count attribute was not
threadsafe -- it was calling a function meant to be only called during
compilation of the stylesheet (yet another reason for breaking the
construction stuff from the runtime stuff).  In addition, I had to wrap a
synchronize(locale) around NumberFormat.getNumberInstance(locale), which I
would think is a Java bug.  Note that we call
NumberFormat.getNumberInstance() in two other places in the code, but do
not pass in the locale object, so I'm not sure I want to try to synchronize
those without a specific problem being found.

The fact that this bug was found at this stage makes me think that we have
to run thread safety tests with every one of our conformance tests.  Ugh.
We have done a LOT of thread safety testing, but I guess not comprehensive
enough.

> May be related to bug 30 raised by bloritsch@infoplanning.com?

I don't think so.  We think this was related to the version of Cocoon that
did not have Xalan correctly configured for concurrent processing.

Again, many thanks.

-scott




                                                                                                                            
                    bugzilla-daemon@locus.                                                                                  
                    apache.org                    To:     Scott_Boag@lotus.com                                              
                                                  cc:                                                                       
                    03/10/00 12:49 PM             Subject:     [Bug 47] New - Xalan throws exceptions in a multithreaded    
                                                  environment with 'xsl:number'                                             
                                                                                                                            




http://xml.apache.org/bugs/show_bug.cgi?id=47

*** shadow/47        Fri Mar 10 09:49:32 2000
--- shadow/47.tmp.14838        Fri Mar 10 09:49:32 2000
***************
*** 0 ****
--- 1,288 ----
+ Bug#: 47
+ Product: Xalan-J
+ Version: unspecified
+ Platform: PC
+ OS/Version: Windows NT
+ Status: NEW
+ Resolution:
+ Severity: major
+ Priority: P2
+ Component: XSLT
+ AssignedTo: Scott_Boag@lotus.com
+ ReportedBy: christian.glencross@gs.com
+ URL:
+ Summary: Xalan throws exceptions in a multithreaded environment with
'xsl:number'
+
+ I've been writing a Java Server Page which uses Xalan-J 0.20.0 to
transform XML
+ to HTML for presentation. The JSP is multi-threaded. It uses a single
+ StyleSheetRoot instance, and one XSLTProcessor per thread.
+
+ Everything works fine until I change the stylesheet to include a
'<xsl:number
+ level="any"/>' tag. I start getting intermittent errors when multiple
threads
+ access the server concurrently. It does work okay when there are only one
(or
+ two?) concurrent requests, so I don't think it's my stylesheet.
+
+ Java stack traces follow. There are a couple of different types of errors
that
+ occur, but they seem to be in the same code region, somewhere around
+ CountersTable.countNode.
+
+ May be related to bug 30 raised by bloritsch@infoplanning.com?
+
+ -------
+
+ The first type of exception:
+ ----------------------------
+ org.apache.xalan.xpath.XPathProcessorException: pattern = 'footnote'
+ Extra illegal tokens: 'footnote'
+          at org.apache.xalan.xpath.XPathProcessorImpl.error
+ (XPathProcessorImpl.java:1055)
+          at org.apache.xalan.xpath.XPathProcessorImpl.error
+ (XPathProcessorImpl.java:1024)
+          at org.apache.xalan.xpath.XPathProcessorImpl.initMatchPattern
+ (XPathProcessorImpl.java, Compiled Code)
+          at
org.apache.xalan.xslt.Stylesheet.createMatchPattern(Stylesheet.java,
+ Compiled Code)
+          at org.apache.xalan.xslt.ElemNumber.getCountMatchPattern
+ (ElemNumber.java, Compiled Code)
+          at
org.apache.xalan.xslt.ElemNumber.getTargetNode(ElemNumber.java,
+ Compiled Code)
+          at
org.apache.xalan.xslt.CountersTable.countNode(CountersTable.java,
+ Compiled Code)
+          at
org.apache.xalan.xslt.ElemNumber.getCountString(ElemNumber.java,
+ Compiled Code)
+          at org.apache.xalan.xslt.ElemNumber.execute(ElemNumber.java,
Compiled
+ Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemLiteralResult.execute
+ (ElemLiteralResult.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.transformChild
+ (ElemTemplateElement.java, Compiled Code)
+          at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemApplyTemplates.execute
+ (ElemApplyTemplates.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.transformChild
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.findChildren
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.step
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.locationPath
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.XPath.locationPath(XPath.java,
Compiled Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemApplyTemplates.execute
+ (ElemApplyTemplates.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at
org.apache.xalan.xslt.ElemTemplate.execute(ElemTemplate.java:145)
+          at
org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java,
+ Compiled Code)
+          at
org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java:291)
+          at
gs.am.com.xslt.xalan.v1_0.XSLTProcessor.process(XSLTProcessor.java,
+ Compiled Code)
+          at gs.am.com.xslt.xalan.v1_0.XSLTProcessor.process
+ (XSLTProcessor.java:130)
+          at
gs.am.mkt.testpage.v1_0.FundsRenderer.render(FundsRenderer.java:103)
+          at
gs.am.mkt.com.jsp.v1_0.ContentRenderer.run(ContentRenderer.java:34)
+          at gs.am.mkt.com.jsp.v1_0.ContentRenderer.getRenderedContent
+ (ContentRenderer.java:56)
+          at jsp_servlet._public._Funds._jspService(_Funds.java:103)
+          at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
+          at weblogic.servlet.internal.ServletStubImpl.invokeServlet
+ (ServletStubImpl.java, Compiled Code)
+          at weblogic.servlet.internal.ServletContextImpl.invokeServlet
+ (ServletContextImpl.java, Compiled Code)
+          at weblogic.servlet.JSPServlet.service(JSPServlet.java:101)
+          at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
+          at weblogic.servlet.internal.ServletStubImpl.invokeServlet
+ (ServletStubImpl.java, Compiled Code)
+          at weblogic.servlet.internal.ServletContextImpl.invokeServlet
+ (ServletContextImpl.java, Compiled Code)
+          at weblogic.servlet.internal.ServletContextImpl.invokeServlet
+ (ServletContextImpl.java:238)
+          at weblogic.socket.MuxableSocketHTTP.invokeServlet
+ (MuxableSocketHTTP.java:501)
+          at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:260)
+          at weblogic.t3.srvr.ExecuteThread.run(ExecuteThread.java,
Compiled Code)
+
+ The second type of exception:
+ ----------------------------
+ java.lang.NullPointerException
+          at org.apache.xalan.xpath.XPathProcessorImpl.initMatchPattern
+ (XPathProcessorImpl.java, Compiled Code)
+          at
org.apache.xalan.xslt.Stylesheet.createMatchPattern(Stylesheet.java,
+ Compiled Code)
+          at org.apache.xalan.xslt.ElemNumber.getCountMatchPattern
+ (ElemNumber.java, Compiled Code)
+          at
org.apache.xalan.xslt.ElemNumber.getPreviousNode(ElemNumber.java,
+ Compiled Code)
+          at
org.apache.xalan.xslt.CountersTable.countNode(CountersTable.java,
+ Compiled Code)
+          at
org.apache.xalan.xslt.ElemNumber.getCountString(ElemNumber.java,
+ Compiled Code)
+          at org.apache.xalan.xslt.ElemNumber.execute(ElemNumber.java,
Compiled
+ Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemLiteralResult.execute
+ (ElemLiteralResult.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.transformChild
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.findChildren
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.step
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.locationPath
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.XPath.locationPath(XPath.java,
Compiled Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemApplyTemplates.execute
+ (ElemApplyTemplates.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.transformChild
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.findChildren
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.step
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.locationPath
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.XPath.locationPath(XPath.java,
Compiled Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemApplyTemplates.execute
+ (ElemApplyTemplates.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemLiteralResult.execute
+ (ElemLiteralResult.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemLiteralResult.execute
+ (ElemLiteralResult.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.transformChild
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.findSelf
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.step
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.locationPath
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.XPath.locationPath(XPath.java,
Compiled Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemApplyTemplates.execute
+ (ElemApplyTemplates.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.transformChild
+ (ElemTemplateElement.java, Compiled Code)
+          at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemForEach.execute(ElemForEach.java,
Compiled
+ Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.transformChild
+ (ElemTemplateElement.java, Compiled Code)
+          at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemForEach.execute(ElemForEach.java,
Compiled
+ Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.transformChild
+ (ElemTemplateElement.java, Compiled Code)
+          at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemApplyTemplates.execute
+ (ElemApplyTemplates.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemLiteralResult.execute
+ (ElemLiteralResult.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.transformChild
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.findChildren
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.step
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.SimpleNodeLocator.locationPath
+ (SimpleNodeLocator.java, Compiled Code)
+          at org.apache.xalan.xpath.XPath.locationPath(XPath.java,
Compiled Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled
Code)
+          at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemApplyTemplates.execute
+ (ElemApplyTemplates.java, Compiled Code)
+          at org.apache.xalan.xslt.ElemTemplateElement.executeChildren
+ (ElemTemplateElement.java, Compiled Code)
+          at
org.apache.xalan.xslt.ElemTemplate.execute(ElemTemplate.java:145)
+          at
org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java,
+ Compiled Code)
+          at
org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java:291)
+          at
gs.am.com.xslt.xalan.v1_0.XSLTProcessor.process(XSLTProcessor.java,
+ Compiled Code)
+          at gs.am.com.xslt.xalan.v1_0.XSLTProcessor.process
+ (XSLTProcessor.java:130)
+          at
gs.am.mkt.testpage.v1_0.FundsRenderer.render(FundsRenderer.java:103)
+          at
gs.am.mkt.com.jsp.v1_0.ContentRenderer.run(ContentRenderer.java:34)
+          at gs.am.mkt.com.jsp.v1_0.ContentRenderer.getRenderedContent
+ (ContentRenderer.java:56)
+          at jsp_servlet._public._Funds._jspService(_Funds.java:103)
+          at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
+          at weblogic.servlet.internal.ServletStubImpl.invokeServlet
+ (ServletStubImpl.java, Compiled Code)
+          at weblogic.servlet.internal.ServletContextImpl.invokeServlet
+ (ServletContextImpl.java, Compiled Code)
+          at weblogic.servlet.JSPServlet.service(JSPServlet.java:101)
+          at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
+          at weblogic.servlet.internal.ServletStubImpl.invokeServlet
+ (ServletStubImpl.java, Compiled Code)
+          at weblogic.servlet.internal.ServletContextImpl.invokeServlet
+ (ServletContextImpl.java, Compiled Code)
+          at weblogic.servlet.internal.ServletContextImpl.invokeServlet
+ (ServletContextImpl.java:238)
+          at weblogic.socket.MuxableSocketHTTP.invokeServlet
+ (MuxableSocketHTTP.java:501)
+          at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:260)
+          at weblogic.t3.srvr.ExecuteThread.run(ExecuteThread.java,
Compiled Code)