Fixing jcr:mixinTypes ValueFormatException in AEM Builds
Pipeline builds in Adobe Experience Manager (AEM) as a Cloud Service fail due to an outdated org.apache.sling.jcr.repoinit
bundle. This issue occurs when a repoInit
script incorrectly assigns a single value to a multi-valued JCR property, triggering a ValueFormatException. This article explains the root cause and provides steps to resolve the issue by updating the bundle and correcting the script.
Description description
Environment
- Adobe Experience Manager (AEM) as a Cloud Service - Sites
- The current version of
org.apache.sling.jcr.repoinit
bundle is 1.1.38. Version 1.154 or later is required. - Pipeline failures occur intermittently during deployments. Development environment deployments typically succeed.
Issue/Symptoms
The pipeline build fails with the following error:
Exception in a SlingRepositoryInitializer, SlingRepository service registration aborted javax.jcr.RepositoryException: Applying repoinit operation failed despite retry; set loglevel to DEBUG to see all exceptions. Last exception message from "Configuration PID 313, script[
0]
" was: Unable to set properties on path [
/conf/somepath]
: javax.jcr.ValueFormatException: Can not assign a single value to multi-valued property: jcr:mixinTypes = mix:lockable
Root cause
The repoInit script attempts to assign jcr:mixinTypes
as a single value instead of as a multi-value array. This causes an unhandled ValueFormatException, which results in pipeline execution failure.
Resolution resolution
To address this issue:
- Modify the repoInit script so that
jcr:mixinTypes
is written as a multi-value array or remove the line if the mixins are already present. - Upgrade the
org.apache.sling.jcr.repoinit
bundle to version 1.154 or later, which includes a fix for this issue. This update might be included in future foundation releases; check release schedules for availability. - Until the updated bundle becomes available, make sure that repoInit scripts use arrays for multi-valued properties.
By implementing these steps, pipeline build failures caused by repository initialization errors can be mitigated effectively.