jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: registering a namespace
Date Fri, 22 Aug 2008 19:04:04 GMT
On Wed, Aug 20, 2008 at 6:06 PM, Michael Harris
<michael.e.harris@gmail.com> wrote:
> if the project is called proj I have a proj.cnd file
> <ns = 'http://whereIwork.org/proj'>
> [ns:file] > nt:file
> - lockHolder (STRING)
> - lockToken (STRING)
> In my spring config for the jcrsessionfactory config
> <property name="namespaces">
>      <props>
>           <prop key="proj">http://whereIwork.org/proj</prop>
>      </props>
> </property>
> I get a NoSuchNodeTypeException
> I see in my test output
> registering namespace [http://whereIwork.org/proj] under [proj]
> In my test I try
> Node fileNode = parentFolder.addNode(name, "proj:file");
> what am i missing?  Do I change the "ns" to "proj" in my .cnd file?

Yes this will most likely fix your problem.

Not sure what the spring jcrsessionfactory does with the namespaces in
the config; to handle your case properly, it should set the prefixes
on the session, ie. to overwrite the default prefix "ns" for
http://whereIwork.org/proj that is stored in the repository. But I
guess it just tries to register the namespace on the repository, which
probably fails (is there a warning in your logs?) because the
namespace uri is already present.


Alexander Klimetschek

View raw message