[ http://jira.nuxeo.org/browse/NXP-2750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44293#action_44293 ]
Florent Guillaume commented on NXP-2750: ---------------------------------------- The culprit was SQLComplexListProperty.getValue. > SQL storage: problem with a ListProperty inside a ComplexProperty > ----------------------------------------------------------------- > > Key: NXP-2750 > URL: http://jira.nuxeo.org/browse/NXP-2750 > Project: Nuxeo Enterprise Platform > Issue Type: Bug > Components: Core SQL Storage > Affects Versions: 5.1.6 > Reporter: Olivier Grisel > Assignee: Florent Guillaume > Fix For: 5.1.7 > > > 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) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nuxeo.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira _______________________________________________ ECM-tickets mailing list ECM-tickets@lists.nuxeo.com http://lists.nuxeo.com/mailman/listinfo/ecm-tickets