You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Christian Holzer (JIRA)" <ji...@apache.org> on 2015/04/22 16:50:00 UTC
[jira] [Closed] (OLINGO-630) Exception is thrown when serializing
the complex type properties of entities in Car/manufacturer example Service
( serializing Manufacturer entities having Address complex type property)
[ https://issues.apache.org/jira/browse/OLINGO-630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Holzer closed OLINGO-630.
-----------------------------------
Resolution: Fixed
Assignee: Christian Holzer
Thanks for you patch. Good job! I have just added your patch to the repository [OLINGO-630|https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=commit;h=a5c51d6f8d23f3d1b05cea8957e894c09a412932]
Kind regards
Christian
> Exception is thrown when serializing the complex type properties of entities in Car/manufacturer example Service ( serializing Manufacturer entities having Address complex type property)
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: OLINGO-630
> URL: https://issues.apache.org/jira/browse/OLINGO-630
> Project: Olingo
> Issue Type: Bug
> Components: odata4-server
> Affects Versions: (Java) V4 4.0.0-beta-03
> Reporter: Kevin Ratnasekera
> Assignee: Christian Holzer
> Priority: Trivial
> Attachments: complex_type_serialization_exception_car_manufacturer_example.patch
>
>
> java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.apache.olingo.commons.api.data.ComplexValue exception is thrown in the ODataSerializer method
> writeComplexValue((EdmComplexType) edmProperty.getType(), property.asComplex().getValue(),selectedPaths, json);
> Root cause for the issue is when invoking
> property.asComplex()
> public ComplexValue asComplex() {
> if(isCollection()) {
> return null;
> }
> return isComplex() ? (ComplexValue) value : null;
> }
> here the value Object is first initialized to List<Property> at the Car/manufacturer Service later it is being casted to ComplexValue.
> Herewith attached a patch, proper type is set to value Object, so that no cast exaception is thrown later when serializing complex types.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)