org.nuxeo.ecm.core.api.model.PropertyNotFoundException: Property not found: major_version.

JIRA | Radu Darlea | 9 years ago
  1. 0

    Suppose we have a document in a SQL storage that has a property attachedFile with the following structure: <xs:element name="attachedFile" type="nxs:fileext" /> <xs:complexType name="fileext"> <xs:sequence> <xs:element name="vignettes" type="nxs:vignettes" /> <xs:element name="name" type="xs:string" /> </xs:sequence> </xs:complexType> <xs:complexType name="vignettes"> <xs:sequence> <xs:element name="vignette" type="nxs:vignette" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="vignette"> <xs:sequence> <xs:element name="width" type="xs:integer" /> <xs:element name="height" type="xs:integer" /> <xs:element name="content" type="nxs:content"/> </xs:sequence> </xs:complexType> Build a Map that contains a non null empty list, set it as property value for "cmpf:attachedFile", save the document close the session, reopen a new session and refetch the document model . Trying to access the property "cmpf:attachedFile" logs the following stacktrace: Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception: java.lang.ClassCastException. message: org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty at org.nuxeo.ecm.core.api.model.impl.ListProperty.init(ListProperty.java:195) at org.nuxeo.ecm.core.api.model.impl.ComplexProperty.init(ComplexProperty.java:182) at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocument.readOneProperty(SQLDocument.java:182) at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocument.readPropertyContainer(SQLDocument.java:165) at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocument.readDocumentPart(SQLDocument.java:154) at org.nuxeo.ecm.core.api.DocumentModelFactory.exportSchema(DocumentModelFactory.java:310) And then fail with the exception: org.nuxeo.ecm.core.api.model.PropertyNotFoundException: Property not found: cmpf:attachedFile. Document dont' implement schema: cmpf at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getProperty(DocumentModelImpl.java:1455) at org.nuxeo.ecm.core.storage.sql.coremodel.TestSQLRepositoryAPI.testComplexType(TestSQLRepositoryAPI.java:231)

    JIRA | 8 years ago | Olivier Grisel
    org.nuxeo.ecm.core.api.model.PropertyNotFoundException: Property not found: cmpf:attachedFile. Document dont' implement schema: cmpf
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.nuxeo.ecm.core.api.model.PropertyNotFoundException

      Property not found: major_version.

      at org.nuxeo.ecm.core.api.model.impl.ComplexProperty.get()
    2. org.nuxeo.ecm
      ExternalEditWSImpl.getSimplePropertyUtility
      1. org.nuxeo.ecm.core.api.model.impl.ComplexProperty.get(ComplexProperty.java:151)
      2. org.nuxeo.ecm.core.api.model.impl.AbstractProperty.resolvePath(AbstractProperty.java:397)
      3. org.nuxeo.ecm.core.api.model.impl.AbstractProperty.resolvePath(AbstractProperty.java:358)
      4. org.nuxeo.ecm.platform.jaxws.ExternalEditWSImpl.getSimplePropertyUtility(ExternalEditWSImpl.java:420)
      4 frames