When adding only one sub field in a complex field, the following error occurs at Nuxeo startup:
Caused by: java.lang.ClassCastException: org.nuxeo.ecm.core.schema.types.ListTypeImpl cannot be cast to org.nuxeo.ecm.core.schema.types.ComplexType
This is due to bad generation of sub field elements.