Adobe Experience Manager: “OakName0001: Invalid namespace prefix” error during package installation

This article provides a solution for the Adobe Experience Manager (AEM) issue where you get the “OakName0001: Invalid namespace prefix” error when installing a package into a new AEM instance as part of data migration.

Description description

The following error may occur when you install a package into a new AEM instance as part of data migration.

Example logs:

*ERROR* [ qtp2105113305-2613]  org.apache.jackrabbit.vault.fs.io.Importer Error while committing <package contents path> javax.jcr.RepositoryException: OakName0001: Invalid namespace prefix(...): custom

This article describes the cause of this error and how to resolve it.

Environments
AEM 6.5

Resolution resolution

This error indicates a node or a property with an unregistered namespace in the package.
As to the example in the Description, “custom” is the unregistered namespace.
The namespace is an ID that identifies metadata. For instance, cq and jcr are predefined namespaces.

Register the missing namespace using the CRX Explorer, referencing the AEM where you created the package.

  1. Go to CRX Explorer (http://localhost:4502/crx/explorer/index.jsp) and login as admin user
  2. Select “Node Type Administration”
  3. Select “Namespaces” in the header section of Node Type Administration dialog
  4. Select “New” at the bottom of Namespaces dialog
  5. Input the URI and the prefix for the missing namespace
         e.g. https://example.com/custom for the URI and “custom” for the prefix.
         Please take the values from the AEM instance where you created the package.
  6. Reinstall the package
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f