You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Edgar Poce <ed...@gmail.com> on 2004/12/31 05:34:29 UTC

XMLPersistenceManager problem and Happy new year :)

Hi
  I'm a new user of jackrabbit. After running a few test cases which 
produced abnormal terminations caused by misuse of the API the 
repository got broken. I mean broken because the dump example from 
http://incubator.apache.org/jackrabbit/firststeps.html started to throw 
ItemNotFoundException. At some point the root node remained pointing to 
a child already deleted.

I dived into the code and found that XMLPersistenceManager adds child 
node entries without checking the existence of the node.xml file (line 
233). I think it should add only checked nodes and log an error message 
when an inconsistency is found.

One more thing, it took me a time to realize how to register custom 
namespaces and nodetypes. Maybe a hint in firststeps.html would help. I 
added a line in ns_reg.properties and created a file called 
custom_nodetypes.xml in /repository/nodetypes. Is it the right way?

Best regards
Edgar

Re: XMLPersistenceManager problem and Happy new year :)

Posted by Edgar Poce <ed...@gmail.com>.
> what exactly did you do? is it reproducable?
I did killed the jvm process and i could not reproduce the error.

 > BTW, you could have tried a little harder. a quick look in the code
 > would have been sufficient to find the desired information.
I took a quick look, certainly too quick :)

Edgar

Re: XMLPersistenceManager problem and Happy new year :)

Posted by Stefan Guggisberg <st...@gmail.com>.
hi edgar

On Fri, 31 Dec 2004 01:34:29 -0300, Edgar Poce <ed...@gmail.com> wrote:
> Hi
>   I'm a new user of jackrabbit. After running a few test cases which
> produced abnormal terminations caused by misuse of the API the
> repository got broken. 

what exactly did you do? is it reproducable?

> I mean broken because the dump example from
> http://incubator.apache.org/jackrabbit/firststeps.html started to throw
> ItemNotFoundException. At some point the root node remained pointing to
> a child already deleted.

with the current code it shouldn't be possible to get into this state 
(unless you kill the jvm process). i'm curious therefore how you managed
to break the repository.

> 
> I dived into the code and found that XMLPersistenceManager adds child
> node entries without checking the existence of the node.xml file (line
> 233). I think it should add only checked nodes and log an error message
> when an inconsistency is found.

a redesign of the PersistenceManager interface (amongst others) is currently
in the works.  the new design will make it easier to implement
PersistenceManagers
backed by transactional stores.

> 
> One more thing, it took me a time to realize how to register custom
> namespaces and nodetypes. Maybe a hint in firststeps.html would help. I
> added a line in ns_reg.properties and created a file called
> custom_nodetypes.xml in /repository/nodetypes. Is it the right way?

no! registering namespaces is covered by the JCR api. see
Workspace.getNamespaceRegistry().
registering custom node types is not covered by the JSR170 spec
and is therefore implementation specific. see 
NodeTypeRegistry.registerNodeType(NodeTypeDef).

BTW, you could have tried a little harder. a quick look in the code
would have been sufficient to find the desired information. names 
like NamespaceRegistry and NodeTypeRegistry are IMO pretty 
self-explanatory.

stefan

> 
> Best regards
> Edgar
>