Hi, Kumar.

Kumar Pandey <[EMAIL PROTECTED]> wrote on 2005-06-05 04:39:39 PM:
> jdk :1.5.0_02-b09
> xalan: 2.6.0
> 
> I'm creating a static template using
> TransformerFactory.newTemplates().
> creation block is synchronized as it gets called in a
> servlet.
> 
> Then for each web request I create a new Transformer
> like so -
> 
> transformerForARequest =
> staicTemplateInstance.newTransformer();
> 
> Then I proceed with the transformation on xml data.
...
> java.lang.NullPointerException
>    at
> org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.addNode(DOM2DTM.java:237)
>    at
> org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.nextNode(DOM2DTM.java:539)
>    at

     It looks like the NullPointerException is being thrown from the 
following piece of code - the line that checks whether name equals or 
begins with "xmlns".

    if (Node.ATTRIBUTE_NODE == type)
    {
      String name = node.getNodeName();

      if (name.startsWith("xmlns:") || name.equals("xmlns"))
      {
        type = DTM.NAMESPACE_NODE;
      }
    }


     It looks like the call to getNodeName() for an attribute node has 
returned null.  Is the same tree used a input for more than one 
transformation at the same time?  The DOM specification requires 
multi-threaded access (even read access) to a DOM tree to be synchronized. 
 If each thread transforms its own DOM tree, how is the DOM tree created? 
Is it possible that the fault lies there?  Does the processor always throw 
the NPE from the same line in DOM2DTM?

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]

Reply via email to