You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Jeremy Robertson <je...@ldschurch.org> on 2011/03/28 20:57:46 UTC

Ignore unexpected element UnmarshalException

Is there a way to configure a CXF service to ignore the javax.xml.bind.UnmarshalException "unexpected element"?

The desired functionality is that when the unmarshaller hits an element that it does not understand, it ignores it and moves on, rather than throwing the above exception.

We generate both services and clients, and in previous versions of CXF (I think pre 2.3), elements that were not understood were ignored. This allowed us to extend data objects in the service without having to rebuild clients in legacy systems. Having upgraded a project to 2.3.1, I am now getting the unexpected element error (I'm not entirely sure what other dependencies were also upgraded, so it may be separate from CXF, in which case, sorry to bother).

Is there a property I can set on the JAXBDataBinding class that will affect this? Is there somewhere online I should be looking (I've tried, but haven't found much yet)?

Thanks for your time,
Jeremy


 NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.



Re: Ignore unexpected element UnmarshalException

Posted by Sergey Beryozkin <sb...@gmail.com>.
Experimenting with the transformation feature [1], 2.4.0-SNAPSHOT only, may
also be of interest. Using this feature may allow for a more selective
configuration, allowing for some elements which do not have to understood,
be ignored, while still having the validation on...

Sergey

[1] http://cxf.apache.org/docs/transformationfeature.html

On Mon, Mar 28, 2011 at 8:06 PM, Daniel Kulp <dk...@apache.org> wrote:

>
>
> You can set:
>
> "set-jaxb-validation-event-handler" to "false"
>
> as an endpoint/request property.     That should cause it to ignore the
> unknown elements again.
>
> Dan
>
>
>
> On Monday 28 March 2011 2:57:46 PM Jeremy Robertson wrote:
> > Is there a way to configure a CXF service to ignore the
> > javax.xml.bind.UnmarshalException "unexpected element"?
> >
> > The desired functionality is that when the unmarshaller hits an element
> > that it does not understand, it ignores it and moves on, rather than
> > throwing the above exception.
> >
> > We generate both services and clients, and in previous versions of CXF (I
> > think pre 2.3), elements that were not understood were ignored. This
> > allowed us to extend data objects in the service without having to
> rebuild
> > clients in legacy systems. Having upgraded a project to 2.3.1, I am now
> > getting the unexpected element error (I'm not entirely sure what other
> > dependencies were also upgraded, so it may be separate from CXF, in which
> > case, sorry to bother).
> >
> > Is there a property I can set on the JAXBDataBinding class that will
> affect
> > this? Is there somewhere online I should be looking (I've tried, but
> > haven't found much yet)?
> >
> > Thanks for your time,
> > Jeremy
> >
> >
> >  NOTICE: This email message is for the sole use of the intended
> > recipient(s) and may contain confidential and privileged information. Any
> > unauthorized review, use, disclosure or distribution is prohibited. If
> you
> > are not the intended recipient, please contact the sender by reply email
> > and destroy all copies of the original message.
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> Talend - http://www.talend.com
>

Re: Ignore unexpected element UnmarshalException

Posted by Daniel Kulp <dk...@apache.org>.

You can set:

"set-jaxb-validation-event-handler" to "false"

as an endpoint/request property.     That should cause it to ignore the 
unknown elements again.

Dan



On Monday 28 March 2011 2:57:46 PM Jeremy Robertson wrote:
> Is there a way to configure a CXF service to ignore the
> javax.xml.bind.UnmarshalException "unexpected element"?
> 
> The desired functionality is that when the unmarshaller hits an element
> that it does not understand, it ignores it and moves on, rather than
> throwing the above exception.
> 
> We generate both services and clients, and in previous versions of CXF (I
> think pre 2.3), elements that were not understood were ignored. This
> allowed us to extend data objects in the service without having to rebuild
> clients in legacy systems. Having upgraded a project to 2.3.1, I am now
> getting the unexpected element error (I'm not entirely sure what other
> dependencies were also upgraded, so it may be separate from CXF, in which
> case, sorry to bother).
> 
> Is there a property I can set on the JAXBDataBinding class that will affect
> this? Is there somewhere online I should be looking (I've tried, but
> haven't found much yet)?
> 
> Thanks for your time,
> Jeremy
> 
> 
>  NOTICE: This email message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged information. Any
> unauthorized review, use, disclosure or distribution is prohibited. If you
> are not the intended recipient, please contact the sender by reply email
> and destroy all copies of the original message.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com