You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Washeim <es...@canuck.com> on 2000/07/10 20:26:55 UTC

DOM005 Wrong document error

Ok, I'm stumped again. When not :) you ask?

Ok, I have a custom cache which stores objects in a hash and is used forgo
fetching xml from disk . . .

If I could use the hasChanged method, I'd forgo a bunch of this, but, I
can't so...

The objects in the hash have an member field which is a Node object. That
node was created by reading a file from disk and then, XSPUtil wise, cloning
it . . .

When I try to use these (that is, during successive requests, call a getNode
method on the cached object), I get a Wrong Document error...

any suggestions ???

I've made this work before (or so I thought) . . .

-- 
Mark (Poetaster) Washeim

'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.

Quem colorem habet sapientia?'

Evan S. Connell

 



Re: DOM005 Wrong document error

Posted by Mark Washeim <es...@canuck.com>.
on 10/7/00 8:50 pm, Jonathan Stimmel at jon-lists@stimmel.net wrote:

> On Mon, Jul 10, 2000 at 08:26:55PM +0200, Mark Washeim wrote:
> 
>> The objects in the hash have an member field which is a Node object. That
>> node was created by reading a file from disk and then, XSPUtil wise, cloning
>> it . . .
>> 
>> When I try to use these (that is, during successive requests, call a getNode
>> method on the cached object), I get a Wrong Document error...
> 
> The nodes stored in your cache do not belong to the DOM tree being
> built by successive requests (those that are hitting your internal
> cache). You need to use XSPUtil to clone the DOM tree when you
> pull the nodes out of the cache, not when you put them in.


yeah. I knew this. Hence, things only came unravelled after I did load
testing. That is, I discovered that XSPUtil.cloneNode would run into
outOfMemory errors under sufficient load.

I tried increasing the stack memory (up to 50 mb) (-ss and -oss) and to no
avail. That's when I tried removing the clone node that was intact....

I'm also puzzled because I actually have two caches. Stored nodes in the one
case are retrieved successfully! It makes absolutely no sense.

I believe you should be correct and I can certainly make the app succeed on
both cache hits with the addition of the clone. However, the clone doesn't
seem necessary . . .

ah. Ok. It's because xsp:expr does a cloneNode if you pass in an object.
Hence, I'll have the same load problem.

Damn it. Square one . . .

-- 
Mark (Poetaster) Washeim

'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.

Quem colorem habet sapientia?'

Evan S. Connell

 



Re: DOM005 Wrong document error

Posted by Jonathan Stimmel <jo...@stimmel.net>.
On Mon, Jul 10, 2000 at 08:26:55PM +0200, Mark Washeim wrote:

> The objects in the hash have an member field which is a Node object. That
> node was created by reading a file from disk and then, XSPUtil wise, cloning
> it . . .
> 
> When I try to use these (that is, during successive requests, call a getNode
> method on the cached object), I get a Wrong Document error...

The nodes stored in your cache do not belong to the DOM tree being
built by successive requests (those that are hitting your internal
cache). You need to use XSPUtil to clone the DOM tree when you
pull the nodes out of the cache, not when you put them in.