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?

  (gyin@amadeus.com)

Number of messages  2
Registration date
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