XMLReaderManager.releaseXMLReader(reader) - null pointer exception
------------------------------------------------------------------

         Key: XALANJ-2105
         URL: http://issues.apache.org/jira/browse/XALANJ-2105
     Project: XalanJ2
        Type: Bug
    Reporter: Brian Minchau


In a program that is too large to attach, this exception happened:

javax.xml.transform.TransformerException: Variable var13 is 
directly or indirectly referencing itself!
        at org.apache.xalan.transformer.MsgMgr.error(MsgMgr.java:309)
        at org.apache.xalan.transformer.MsgMgr.error(MsgMgr.java:212)
        at org.apache.xalan.templates.XUnresolvedVariable.execute
(XUnresolvedVariable.java:107)
        at org.apache.xpath.VariableStack.getGlobalVariable
(VariableStack.java:446)
        at org.apache.xpath.operations.Variable.execute(Variable.java:212)
        at org.apache.xpath.operations.Variable.execute(Variable.java:186)
        at org.apache.xpath.functions.FunctionDef1Arg.getArg0AsString
(FunctionDef1Arg.java:95)
        at org.apache.xpath.functions.FuncNormalizeSpace.execute
(FuncNormalizeSpace.java:46)
        at org.apache.xpath.functions.FuncSubstringAfter.execute
(FuncSubstringAfter.java:45)
        at org.apache.xpath.XPath.execute(XPath.java:335)
        at org.apache.xalan.templates.ElemVariable.getValue
(ElemVariable.java:278)
        at org.apache.xalan.templates.ElemVariable.execute
(ElemVariable.java:246)
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates
(TransformerImpl.java:2346)
        at org.apache.xalan.templates.ElemTemplate.execute
(ElemTemplate.java:392)
        at org.apache.xalan.templates.ElemCallTemplate.execute
(ElemCallTemplate.java:246)
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates
(TransformerImpl.java:2346)
        at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:116)
        at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes
(ElemApplyTemplates.java:393)
        at org.apache.xalan.templates.ElemApplyTemplates.execute
(ElemApplyTemplates.java:176)
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates
(TransformerImpl.java:2346)
        at org.apache.xalan.templates.ElemLiteralResult.execute
(ElemLiteralResult.java:681)


It appeared that some RTF (result tree fragment) processing was failing while 
evaluating var13.

Investigation showed that this failure occured due to an earlier null pointer 
exception in:
  org.apache.xml.utils.XMLReaderManager.releaseXMLReader(reader);

The problem occurs when reader is null, and the code throws a null pointer 
exception when trying to remove null from the Hashtable. My program works fine 
if the body of that method has this statement:
  if (m_readers.get() == reader)
  {
    m_inUse.remove(reader);
  }

changed to:
  if (m_readers.get() == reader && reader != null)
  {
    m_inUse.remove(reader);
  }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to