[ 
http://issues.apache.org/jira/browse/XALANJ-1364?page=comments#action_57266 ]
     
Joe Kesselman commented on XALANJ-1364:
---------------------------------------

That sounds more like a broken DOM implementation (which one are you using?) 
than breakage in Xalan, but we'd have to see a failing example to be sure.

No, there's no way to turn off DTM at this time; in current versions of Xalan, 
DTM is both our internal document model and our internal API to document 
models. 


Actually, this may be your problem:

"I'm using CachedXPathAPI because the DOM can
change between calls to XPathAPI.selectNodes."

That is a specific case where you MUST NOT use CachedXPathAPI. The DTM wrapper 
is not "live" and will not update itself to track changes to the DOM; those 
changes will cause the wrapper to fall out of synch and produce errors. If you 
really need to do this, either don't use the Cached version of the call 
(inefficient) or try switching over to DOM2DTM2 (experimental, untested, 
different set of inefficiencies).

One of the goals of the XDM proposal was to avoid these issues when running 
across a DOM. Unfortunately I haven't had time to pursue that.

> Random NullPointerExceptions in DTM traversal
> ---------------------------------------------
>
>          Key: XALANJ-1364
>          URL: http://issues.apache.org/jira/browse/XALANJ-1364
>      Project: XalanJ2
>         Type: Bug
>   Components: DTM
>     Versions: 2.4
>  Environment: Operating System: Windows NT/2K
> Platform: PC
>     Reporter: Vikram Pillai
>     Assignee: Xalan Developers Mailing List

>
> I see the following exception on some traversals of the DOM and not on 
> others. 
> It typically happens when the system is heavily loaded and there are a number 
> of traversals occurring concurrently. In reading the source for DOM2DTM, pos 
> being null seems to be a "should never arise" situation -- but it certainly 
> seems to be exercised for me. BTW I'm using CachedXPathAPI because the DOM 
> can 
> change between calls to XPathAPI.selectNodes.
> Is there any way to turn off the DTM optimization. I'm willing to accept the 
> performance hit if the traversals work reliably.
> java.lang.NullPointerException
>       at org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.nextNode(DOM2DTM.java:421)
>       at org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.getHandleFromNode
> (DOM2DTM.java:710)
>       at org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.getHandleOfNode
> (DOM2DTM.java:762)
>       at org.apache.xml.dtm.ref.DTMManagerDefault.getDTMHandleFromNode
> (DTMManagerDefault.java:620)
>       at org.apache.xpath.XPathContext.getDTMHandleFromNode
> (XPathContext.java:220)
>       at org.apache.xpath.CachedXPathAPI.eval(CachedXPathAPI.java:326)
>       at org.apache.xpath.CachedXPathAPI.selectNodeIterator
> (CachedXPathAPI.java:216)
>       at org.apache.xpath.CachedXPathAPI.selectSingleNode
> (CachedXPathAPI.java:177)
>       at com.silverbacktech.cpe.xml.XPathAPI.selectSingleNode
> (XPathAPI.java:13)
>       at com.silverbacktech.cpe.xml.XSL.selectSingleNode(XSL.java:43)
>       at com.silverbacktech.cpe.xhandler.ReportHandler.select
> (ReportHandler.java:106)
>       at com.silverbacktech.cpe.xhandler.ReportHandler.lookupAll
> (ReportHandler.java:30)
>       at com.silverbacktech.core.xspace.BaseHandler.lookup
> (BaseHandler.java:55)
>       at com.silverbacktech.core.xspace.VirtualNodeExpander.expand
> (XSpaceExpander.java:277)
>       at com.silverbacktech.core.xspace.XSpaceExpander.expand
> (XSpaceExpander.java:56)
>       at com.silverbacktech.core.xspace.XSpace.selectSingleNode
> (XSpace.java:122)
>       at com.silverbacktech.cpe.seil.XSpaceServlet.doGet
> (XSpaceServlet.java:82)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:499)
>       at com.silverbacktech.cpe.seil.SBServlet.service(SBServlet.java:243)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
>       at org.apache.jserv.JServConnection.processRequest
> (JServConnection.java:317)
>       at org.apache.jserv.JServConnection.run(JServConnection.java:188)
>       at java.lang.Thread.run(Unknown Source)

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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

Reply via email to