Hi,

I have this code :

    try
    {
      session.getNamespaceURI("xyz");
    }
    catch (NamespaceException notexist)
    {
      session.getWorkspace().getNamespaceRegistry(). // BING !
        registerNamespace(
        "xyz", "http://www.foo.com";);
    }


... but, at line BING, I get this exception :

javax.jcr.NamespaceException: failed to register namespace xyz ->
http://www.foo.com: mapping already exists
    at
org.apache.jackrabbit.core.NamespaceRegistryImpl.registerNamespace(NamespaceRegistryImpl.java:406)
    at
org.apache.jackrabbit.core.session.SessionContext$PermissionAwareNamespaceRegistry.registerNamespace(SessionContext.java:375)


How is it possilbe ? What is the good thing to do to register a namespace ?

Thanks.

Reply via email to