commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitriy Frolov <dmitriy.fro...@gmail.com>
Subject Re: DOMNodePointer null pointer exception
Date Fri, 19 Nov 2004 21:23:10 GMT
Ok, just wanted to let everybody know my findings.  The following
problem occurs only when using jxpath and xerces libraries within the
same project.  Xerces overrides sun dom implementation that jxpath is
using and appears to be not thread safe.

When performing tests with sun default dom implementation I was not
able to reproduce the problem.

Dmitriy

On Wed, 17 Nov 2004 15:02:01 -0500, Dmitriy Frolov
<dmitriy.frolov@gmail.com> wrote:
> Hi all,
> has anybody experienced a null pointer exception thrown by
> DOMNodePointer in a multithreaded environment.  This exception is
> inconsistent and looks like concurency related.  Each thread creates
> its own instance of jxpathcontext on a Document which is shared by all
> theads where the access to that document is synchronized.
> 
> I have the following stock trace:
> at org.apache.commons.jxpath.ri.model.dom.DOMNodePointer.testNode(DOMNodePointer.java(Compiled
> Code))
>         at org.apache.commons.jxpath.ri.model.dom.DOMNodeIterator.testChild(DOMNodeIterator.java(Inlined
> Compiled Code))
>         at org.apache.commons.jxpath.ri.model.dom.DOMNodeIterator.next(DOMNodeIterator.java(Compiled
> Code))
>         at org.apache.commons.jxpath.ri.model.dom.DOMNodeIterator.setPosition(DOMNodeIterator.java(Compiled
> Code))
>         at org.apache.commons.jxpath.ri.axes.ChildContext.nextNode(ChildContext.java(Compiled
> Code))
>         at org.apache.commons.jxpath.ri.axes.UnionContext.setPosition(UnionContext.java:56)
>         at org.apache.commons.jxpath.ri.axes.NodeSetContext.nextNode(NodeSetContext.java:64)
>         at org.apache.commons.jxpath.ri.EvalContext.constructIterator(EvalContext.java:181)
>         at org.apache.commons.jxpath.ri.EvalContext.hasNext(EvalContext.java(Compiled
> Code))
>         at com.starwood.sherlock.corona.pdna.InMemoryPdnaQuery.getContent(InMemoryPdnaQuery.java:143)
> 
> where
> 
> getContent method contains the following piece of code:
> Iterator i = propertyJXPC.iteratePointers(sb.toString());
> while (i.hasNext()) {
>         Pointer p = (Pointer) i.next();
>         Node node = (Node)p.getNode();
>         ...
> }
> 
> Thanks,
> Dmitriy
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message