Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-29840

Making writing Double property in JSON marshallers support Long values

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Number values can be written to both Long and Double properties.
    • Backlog priority:
      800
    • Sprint:
      nxplatform #22, nxplatform #23
    • Story Points:
      3

      Description

      The goal is to handle possible document model changes from Long to Double (it should be possible to return 72.0 if the stored value is 72)

      In Core IO

      Caused by: java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Double (java.lang.Long and java.lang.Double are in module java.base of loader 'bootstrap')
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter.writeScalarPropertyValue(DocumentPropertyJsonWriter.java:139)
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter.writeScalarProperty(DocumentPropertyJsonWriter.java:127)
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter.writeProperty(DocumentPropertyJsonWriter.java:111)
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter.write(DocumentPropertyJsonWriter.java:105)
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter.write(DocumentPropertyJsonWriter.java:91)
      	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81)
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonWriter.writeSchemaProperties(DocumentModelJsonWriter.java:255)
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonWriter.writeEntityBody(DocumentModelJsonWriter.java:199)
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonWriter.writeEntityBody(DocumentModelJsonWriter.java:114)
      	at org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter.write(ExtensibleEntityJsonWriter.java:80)
      	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81)
      

      In Automation:

      Caused by: java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Double (java.lang.Long and java.lang.Double are in module java.base of loader 'bootstrap')
      	at org.nuxeo.ecm.automation.core.util.JSONPropertyWriter.writeScalarProperty(JSONPropertyWriter.java:230) ~[nuxeo-automation-core-10.10-HF34.jar:?]
      	at org.nuxeo.ecm.automation.core.util.JSONPropertyWriter.writeProperty(JSONPropertyWriter.java:194) ~[nuxeo-automation-core-10.10-HF34.jar:?]
      	at org.nuxeo.ecm.automation.core.util.JSONPropertyWriter.writeProperty(JSONPropertyWriter.java:181) ~[nuxeo-automation-core-10.10-HF34.jar:?]
      	at org.nuxeo.elasticsearch.io.JsonESDocumentWriter.writeProperties(JsonESDocumentWriter.java:220) ~[nuxeo-elasticsearch-core-10.10-HF32.jar:?]
      	at org.nuxeo.elasticsearch.io.JsonESDocumentWriter.writeSchemas(JsonESDocumentWriter.java:172) ~[nuxeo-elasticsearch-core-10.10-HF32.jar:?]
      	at org.nuxeo.elasticsearch.io.JsonESDocumentWriter.writeESDocument(JsonESDocumentWriter.java:192) ~[nuxeo-elasticsearch-core-10.10-HF32.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.source(ElasticSearchIndexingImpl.java:433) ~[nuxeo-elasticsearch-core-10.10-HF32.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.buildEsIndexingRequest(ElasticSearchIndexingImpl.java:415) ~[nuxeo-elasticsearch-core-10.10-HF32.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.processBulkIndexCommands(ElasticSearchIndexingImpl.java:178) ~[nuxeo-elasticsearch-core-10.10-HF32.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.indexNonRecursive(ElasticSearchIndexingImpl.java:147) ~[nuxeo-elasticsearch-core-10.10-HF32.jar:?]
      	at org.nuxeo.elasticsearch.ElasticSearchComponent.indexNonRecursive(ElasticSearchComponent.java:420) ~[nuxeo-elasticsearch-core-10.10-HF32.jar:?]
      	at org.nuxeo.elasticsearch.work.BucketIndexingWorker.doWork(BucketIndexingWorker.java:78) ~[nuxeo-elasticsearch-core-10.10-HF32.jar:?]
      	at org.nuxeo.elasticsearch.work.BaseIndexingWorker.work(BaseIndexingWorker.java:48) ~[nuxeo-elasticsearch-core-10.10-HF32.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:493) ~[nuxeo-core-event-10.10-HF34.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:383) ~[nuxeo-core-event-10.10-HF34.jar:?] 

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours
                5h