Any harm in missing namespaces? | Community
Skip to main content
tim_funk
New Participant
March 11, 2020
Solved

Any harm in missing namespaces?

  • March 11, 2020
  • 1 reply
  • 2599 views

I'm working on building AEM from a clean install. (for an upgrade)

 

I'm using crx2oak to copy the old repository to the new one. All has worked great so far until today when i wanted to build a package and ran into this "javax.jcr.NamespaceException: Unknown namespace prefix" exactly like this:

https://experienceleaguecommunities.adobe.com/t5/Adobe-Experience-Manager/Error-while-build-the-package/qaq-p/316820

 

Which was nicely fixed by this:

https://helpx.adobe.com/experience-manager/kb/javax-jcr-NamespaceException-Unknown-namespace-prefix-error-in-AEM.html

 

So my question? I checked my old vs new environment and found many more missing namespaces. Aside from not being able to create a package - what other issues are lurking out there. It appears I can kind of script the insertion via curl by something like this:

 

curl -X POST -u $CREDENTIALS -F Callback=reload -F NewPrefix=exifEX -F NewURI=http://cipa.jp/exif/1.0/ "http://$AUTHOR:4502/crx/explorer/ui/namespace_editor.jsp?ck=1583942759354&Path='

 

 

But before I got though that effort, is it worth it?

 

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

crx2oak cannot handle namespaces, as indicated by [1]. But content-packages do.

 

So I could imagine a way, that you prime your new repo with some content-packages, which are mainly used to deploy some assets (most likely the namespaces originate from assets) into the new repo. Then migrate the content via crx2oak.

 

A different approach could be to use sling repoinit [2] to create all JCR namespaces in the new instance before you run crx2oak. You can write some code to export all existing JCR namespaces in the repoinit language and feed this as part of an OSGI configuration into the new instance, and then run crx2oak afterwards. Probably more reliable than the packaging approach above.

 

regards,

Jörg

 

 

[1] https://helpx.adobe.com/experience-manager/kb/javax-jcr-NamespaceException-Unknown-namespace-prefix-error-in-AEM.html

[2] https://sling.apache.org/documentation/bundles/repository-initialization.html#the-repoinit-repository-initialization-language

1 reply

joerghoh
joerghohAccepted solution
Employee
March 13, 2020

crx2oak cannot handle namespaces, as indicated by [1]. But content-packages do.

 

So I could imagine a way, that you prime your new repo with some content-packages, which are mainly used to deploy some assets (most likely the namespaces originate from assets) into the new repo. Then migrate the content via crx2oak.

 

A different approach could be to use sling repoinit [2] to create all JCR namespaces in the new instance before you run crx2oak. You can write some code to export all existing JCR namespaces in the repoinit language and feed this as part of an OSGI configuration into the new instance, and then run crx2oak afterwards. Probably more reliable than the packaging approach above.

 

regards,

Jörg

 

 

[1] https://helpx.adobe.com/experience-manager/kb/javax-jcr-NamespaceException-Unknown-namespace-prefix-error-in-AEM.html

[2] https://sling.apache.org/documentation/bundles/repository-initialization.html#the-repoinit-repository-initialization-language