jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: Namespace registration
Date Thu, 12 Jun 2008 22:44:04 GMT
On Thu, Jun 12, 2008 at 6:56 PM, viz06 <vijaykumarsharma_1999@yahoo.com> wrote:
> Issue 1) While attempting registering nodeType (mypc.cnd file) I get the
> exception 'mypc' is not a registered namespace prefix.

The namespaces have to be registered before you import node type
definition files. The namespace declarations in the cnd file are not
automatically registered.

> What is the standard way of registering namespaces?

Doing it with the standard JCR API:

NamespaceRegistry registry = session.getWorkspace().getNamespaceRegistry();
registry.registerNamespace("ns", "http://server.com/my-namespace/");

Note that re-registering an existing namespace gives an exception.
Also see the Javadocs:

In the case of the spring jcr module, the namespaces can be defined in
the spring config - which you already did. Maybe the additional
parameters like "forceNamespacesRegistration" are important


Alexander Klimetschek

View raw message