Skip to content

[personality-insights] NullPointerException when serializing a Profile with Jackson #151

@l2fprod

Description

@l2fprod

Hello,

I want to persist the Personality Insights Profile in Cloudant with Ektorp which uses Jackson. Jackson throws NullPointerException when serializing a Trait:

    ... 9 more
Caused by: java.lang.NullPointerException
    at com.ibm.watson.developer_cloud.personality_insights.v2.model.Trait.getRawScore(Trait.java:115)

Debugging the rawScore object is null, thus the unboxing to "double" fails when getRawScore is called, leading to NPE

So is the use of Double a typo or is it on purpose? In in java-sdk/src/main/java/com/ibm/watson/developer_cloud/personality_insights/v2/model/Trait.java:

  /** The raw sampling error. */
  @SerializedName("raw_sampling_error")
  private Double rawSamplingError;

  /** The raw score. */
  @SerializedName("raw_score")
  private Double rawScore;

  /** The sampling error. */
  @SerializedName("sampling_error")
  private double samplingError;

thanks.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions