[ 
https://issues.apache.org/jira/browse/GEODE-4739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17101906#comment-17101906
 ] 

Blake Bender commented on GEODE-4739:
-------------------------------------

A no-argument ctor is a requirement for .net reflection-based serialization, so 
an exception is still the right thing to do here.  Recent changes to the 
autoserializer, however, fixed this in the course of other improvements.  It 
now throws an IllegalStateException with the message "Object missing public 
no-arg constructor," which is much friendlier than a NullReferenceException.  
Screenshot attached. !image.png!

> Null reference exception when using CLI reflection serializer and default 
> constructor is missing
> ------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-4739
>                 URL: https://issues.apache.org/jira/browse/GEODE-4739
>             Project: Geode
>          Issue Type: Bug
>          Components: native client
>            Reporter: Ryan McMahon
>            Priority: Major
>             Fix For: 1.13.0
>
>         Attachments: image.png
>
>
> When using reflection based auto serialization and the CLI Geode Native 
> client, it is required that any domain objects implement default 
> constructors.  If a default constructor isn't implemented, then serialization 
> fails ungracefully with a null reference exception.  Better error handling 
> for this case should be added.
> Steps to reproduce:
>  # Open the PdxAutoSerializer example in the examples packaged with 
> geode-native
>  # Remove the default constructor from the Order class
>  # Run the example and observe the null reference exception
> Acceptance criteria:
> A test should be written which captures the same steps to reproduce described 
> above. Better error handling which indicates the root of the issue should be 
> implemented, rather than throwing a null reference exception.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to