javax.jcr.NamespaceException: Unknown namespace prefix error in AEM
This article offers a solution to the error "javax.jcr.NamespaceException: Unknown namespace prefix"
in AEM.
Description :headding-anchor:description
Environment
Adobe Experience Manager
Issue
If the error below appear in the logs:
javax.jcr.NamespaceException: Unknown namespace prefix: [ namespacename]
Could not Build Package "Unknown namespace prefix: [ namespacename]
Cause
This error usually shows up in environments where partial data migration was done using the crx2oak tool.
The crx2oak tool doesn’t support migrating namespaces with the data.
Resolution :headding-anchor:resolution
Solution
To resolve this issue, follow these steps:
-
Register the missing namespaces via the CRX Explorer:
-
Go to
http://hostname:port/crx/explorer/index.jsp
and log in as admin user. -
Click Node Type Administration in the CRX Explorer.
-
In the Node Type Administration window, click Namespaces, which is at far right of the toolbar.
-
At the bottom of the Namespaces window, click New.
-
Enter the URI and the Namespace mapping, then click OK.
-
Enter the prefix of the Namespace mapping, then click OK.