Jahia in English > Changing a namespace...

0 (0 Good)
0 (0 Bad)

Changing a namespace prefix

by  gyin@amadeus.com »  2018/01/18 17:08

I am tring to change the namespace associated to a specific namespace prefix.

My definition was as follows:

<myobjectnt = 'http://subdomain.domain/org/nt/1.0'>

and then I tried to change into:

<myobjectnt = 'http://subdomain.domain.org/nt/1.0'>

When trying to save I have the following error: 

Cannot compile module: Invalid namespace declaration : prefix already declared (definitions.cnd, line 3) (definitions.cnd)

If I do the change directly in the file system (digital-factory-data/sources/mymodulename/src/main/resources/META-INF/definitions.cnd), and then try to mvn install, this works without problem. I can see in my ~/.m2/repository's jar that the reference to the previous namespace has disappeared.

However, if I come back to the studio, and try to build using the "Compile and deploy" button, I still have the same error:

Cannot compile module: Invalid namespace declaration : prefix already declared (definitions.cnd, line 3) (definitions.cnd)

Am I missing anything?

  • Changing a namespace prefix
    2018/01/18 17:08

    gyin@amadeus.com <p>I am tring to change the namespace associated to a specific namespace prefix.</p> <p>My definition was as follows:</p> <p>&lt;myobjectnt = &#39;http://subdomain.domain/org/nt/1.0&#39;&gt;</p> <p>and then I tried to change into:</p> <p>&lt;myobjectnt = &#39;http://subdomain.domain.org/nt/1.0&#39;&gt;</p> <p>When trying to save I have the following error:&nbsp;</p> <p><span style="color: rgb(0, 0, 0); font-family: tahoma, arial, helvetica, sans-serif; font-size: 11px; background-color: rgb(245, 246, 247);">Cannot compile module: Invalid namespace declaration : prefix already declared (definitions.cnd, line 3) (definitions.cnd)</span></p> <p>If I do the change directly in the file system (digital-factory-data/sources/mymodulename/src/main/resources/META-INF/definitions.cnd), and then try to mvn install, this works without problem. I can&nbsp;see in my ~/.m2/repository&#39;s&nbsp;jar that the reference to the previous namespace has disappeared.</p> <p>However, if I come back to the studio, and try to build using the &quot;Compile and deploy&quot; button, I still have the same error:</p> <p><span style="color: rgb(0, 0, 0); font-family: tahoma, arial, helvetica, sans-serif; font-size: 11px; background-color: rgb(245, 246, 247);">Cannot compile module: Invalid namespace declaration : prefix already declared (definitions.cnd, line 3) (definitions.cnd)</span></p> <p>Am I missing anything?</p>

  • Number of messages  2
    Registration date Jan 18, 2018
    0 (0 Good)
    0 (0 Bad)

    Re: Changing a namespace prefix

    by  cefou »  2018/04/13 08:32

    Hello Gyin,

    Not a good idea!
    Following theses best practices published by Jahia : https://academy.jahia.com/documentation/techwiki/misc/development-best-practices

    Namespace Modification Should never be done. Instead of a modification, create a new namespace and stop using the previous one

     Rem: it's possible to clean this kind of problem but it worth it only for a production problem. if you are on a dev setup, put back the original namespace or create a completly new one (new prefix with new url)

    Good luck

     

     

      (cefou)

    Number of messages  17
    Registration date
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page