I don't know of any issues. The code looks to be correct: the "startPrefixMapping" method is called when a new XML namespace is defined, and when the session's registry does not contain the namespace (which means it's not in the session or the workspace) it is then added to the workspace's registry, which automatically persists the namespaces.
Based upon your short snippet of your repository, your repository configuration is not defining and is thus using an in-memory "system" workspace, which is where all the namespaces (and node types, version histories, and locks) are stored. This means that all of the system content is empty again upon restart, so you definitely want to fix this. See the documentation for details, with suggestions on how to configure properly. You should be able to simply define the "system" workspace in your disk source (or call it whatever you like) and then use the "systemSourceName" repository option to a value of "system@test-repository-source".
We know that this was extremely confusing and a frequent problem for people starting out. We've corrected this in ModeShape 3.x to handle this in a much better way.
Out of curiocity, have you been using ModeShape 2.x for a while? If not, is there a reason you chose it over the latest ModeShape 3.1.1.Final?
Hi Randall, and thanks for the quick answer !
I've just tried your solution, and it works fine. So thank you very much for your help.
Regarding your question about the ModeShape release we are using, we've been using ModeShape for about one year now, and at that time, ModeShape 3 was only available as a beta release, so we decided to go with ModeShape 2. But we should consider soon to move to ModeShape 3...
And thanks again for your help.