users@jersey.java.net

[Jersey] Re: Enforcing non null fields with moxy

From: Iaroslav Savytskyi <iaroslav.savytskyi_at_oracle.com>
Date: Mon, 10 Feb 2014 14:26:33 +0100

Hi, Piers,

This is expected behaviour. You have turn on validation to prevent such errors to appear. By default validation is turned off. And we are trying to process whatever data if this doesn’t cause critical errors.

Here is a link for eclipse-link (moxy) mailing lists:

Users: https://dev.eclipse.org/mailman/listinfo/eclipselink-users
Dev: https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

Do not hesitate to ask there if you’ll need more help with MOXy.


Best regards,
Iaroslav

On 10 Feb 2014, at 13:44, Piers Powlesland <piers_at_aptusinteractive.com> wrote:

> Hi, I'm trying to use moxy to marshall/unmarshall pojo's between a jersey server and client, the problem is that the marshalling/unmarshalling seem to work without error when null fields are present in the pojo even though I have set @XmlElement(required=true, nillable=false) on the fields in question.
>
> Is this expected behaviour? To me it seems as if the moxy implementation is not respecting the JAXB annotations. I'm using Jersey version 2.3.1
>
> Thanks for any insight.
>
> Piers