You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Shane Frueh <sa...@hotmail.com> on 2011/06/04 03:30:40 UTC
jaxb validation
Upgrading from CXF 2.2.2 to 2.3.4. We have some client software that's sending the wrong namespace in a request and so we're getting the "Unexpected wrapper element" fault. I find plenty of discussion in previous posts suggesting to:
set-jaxb-validation-event-handler to "false"
Though I've tried a couple of different ways and can't seem to make it work.
I've tried compiling it into the service as an annotation.
@EndpointProperties({
@EndpointProperty(key = "set-jaxb-validation-event-handler", value="false")
})
I've also tried programatically.
final JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
final Map<String, Object> properties = svrFactory.getProperties(true);
properties.put("set-jaxb-validation-event-handler", Boolean.FALSE);
RE: jaxb validation
Posted by Shane Frueh <sa...@hotmail.com>.
Is this available in 2.3.4? I'm not finding it in cxf-rt-core, or in the \apache-cxf-2.3.4-src\rt\core\src\main\java\org\apache\cxf\feature in the src distribution.
> Date: Sat, 4 Jun 2011 15:56:58 +0100
> Subject: Re: jaxb validation
> From: sberyozkin@gmail.com
> To: users@cxf.apache.org
>
> This is exactly what TransformFeature has been created for:
> http://cxf.apache.org/docs/transformationfeature.html
>
> Setting an inTransformElements property like this:
>
> {http://woof.test.vue.com/}* : {http://test.vue.com/}*
>
> (have all elements qualified with http://woof.test.vue.com/ qualified
> with http://test.vue.com/ instead)
>
> should do the trick
>
> Disabling the validation can be a simpler option - however it really
> depends on a particular case, ex, some control may need to be
> exercised in order to avoid unexpected requests/responses
>
> Cheers, Sergey
>
> On Sat, Jun 4, 2011 at 12:50 PM, Shane Frueh <sa...@hotmail.com> wrote:
> >
> > This is the exception I'm getting:
> >
> > Also, programatically, I tried Boolean.FALSE and "false" as the value for "set-jaxb-validation-event-handler".
> >
> > 2011-06-03 14.30.05.406:WARN :Interceptor for {http://test.vue.com/}TestService#{http://test.vue.com/}getAppointment has thrown exception, unwinding now
> > org.apache.cxf.interceptor.Fault: Unexpected wrapper element {http://woof.test.vue.com/}getAppointment found. Expected {http://test.vue.com/}getAppointment.
> > at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:106)
> > at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> > at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
> > at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:311)
> > at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:280)
> > at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> > at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:936)
> > at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:873)
> > at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> > at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)
> > at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> > at org.eclipse.jetty.server.Server.handle(Server.java:346)
> > at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:581)
> > at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1057)
> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:807)
> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
> > at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
> > at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:526)
> > at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:41)
> > at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:528)
> > at java.lang.Thread.run(Thread.java:662)
> >
> >> From: safrueh@hotmail.com
> >> To: users@cxf.apache.org
> >> Subject: jaxb validation
> >> Date: Fri, 3 Jun 2011 20:30:40 -0500
> >>
> >>
> >> Upgrading from CXF 2.2.2 to 2.3.4. We have some client software that's sending the wrong namespace in a request and so we're getting the "Unexpected wrapper element" fault. I find plenty of discussion in previous posts suggesting to:
> >>
> >> set-jaxb-validation-event-handler to "false"
> >>
> >> Though I've tried a couple of different ways and can't seem to make it work.
> >>
> >> I've tried compiling it into the service as an annotation.
> >>
> >> @EndpointProperties({
> >> @EndpointProperty(key = "set-jaxb-validation-event-handler", value="false")
> >> })
> >>
> >> I've also tried programatically.
> >>
> >> final JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
> >> final Map<String, Object> properties = svrFactory.getProperties(true);
> >> properties.put("set-jaxb-validation-event-handler", Boolean.FALSE);
> >>
> >>
> >>
> >
>
>
>
> --
> Sergey Beryozkin
>
> Application Integration Division of Talend
> http://sberyozkin.blogspot.com
Re: jaxb validation
Posted by Sergey Beryozkin <sb...@gmail.com>.
This is exactly what TransformFeature has been created for:
http://cxf.apache.org/docs/transformationfeature.html
Setting an inTransformElements property like this:
{http://woof.test.vue.com/}* : {http://test.vue.com/}*
(have all elements qualified with http://woof.test.vue.com/ qualified
with http://test.vue.com/ instead)
should do the trick
Disabling the validation can be a simpler option - however it really
depends on a particular case, ex, some control may need to be
exercised in order to avoid unexpected requests/responses
Cheers, Sergey
On Sat, Jun 4, 2011 at 12:50 PM, Shane Frueh <sa...@hotmail.com> wrote:
>
> This is the exception I'm getting:
>
> Also, programatically, I tried Boolean.FALSE and "false" as the value for "set-jaxb-validation-event-handler".
>
> 2011-06-03 14.30.05.406:WARN :Interceptor for {http://test.vue.com/}TestService#{http://test.vue.com/}getAppointment has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Unexpected wrapper element {http://woof.test.vue.com/}getAppointment found. Expected {http://test.vue.com/}getAppointment.
> at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:106)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
> at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:311)
> at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:280)
> at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:936)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:873)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> at org.eclipse.jetty.server.Server.handle(Server.java:346)
> at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:581)
> at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1057)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:807)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
> at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
> at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:526)
> at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:41)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:528)
> at java.lang.Thread.run(Thread.java:662)
>
>> From: safrueh@hotmail.com
>> To: users@cxf.apache.org
>> Subject: jaxb validation
>> Date: Fri, 3 Jun 2011 20:30:40 -0500
>>
>>
>> Upgrading from CXF 2.2.2 to 2.3.4. We have some client software that's sending the wrong namespace in a request and so we're getting the "Unexpected wrapper element" fault. I find plenty of discussion in previous posts suggesting to:
>>
>> set-jaxb-validation-event-handler to "false"
>>
>> Though I've tried a couple of different ways and can't seem to make it work.
>>
>> I've tried compiling it into the service as an annotation.
>>
>> @EndpointProperties({
>> @EndpointProperty(key = "set-jaxb-validation-event-handler", value="false")
>> })
>>
>> I've also tried programatically.
>>
>> final JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
>> final Map<String, Object> properties = svrFactory.getProperties(true);
>> properties.put("set-jaxb-validation-event-handler", Boolean.FALSE);
>>
>>
>>
>
--
Sergey Beryozkin
Application Integration Division of Talend
http://sberyozkin.blogspot.com
Re: jaxb validation
Posted by Daniel Kulp <dk...@apache.org>.
This isn't even into the JAXB code yet. At this point, we're just trying to
match up the root of the incoming payload to an operation and if the namespace
is wrong, we cannot do that. We really have no idea what to do with it so
the exception is thrown.
Dan
On Saturday, June 04, 2011 7:50:35 AM Shane Frueh wrote:
> This is the exception I'm getting:
>
> Also, programatically, I tried Boolean.FALSE and "false" as the value for
> "set-jaxb-validation-event-handler".
>
> 2011-06-03 14.30.05.406:WARN :Interceptor for
> {http://test.vue.com/}TestService#{http://test.vue.com/}getAppointment has
> thrown exception, unwinding now org.apache.cxf.interceptor.Fault:
> Unexpected wrapper element {http://woof.test.vue.com/}getAppointment
> found. Expected {http://test.vue.com/}getAppointment. at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLitera
> lInInterceptor.java:106) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha
> in.java:255) at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiation
> Observer.java:113) at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(Je
> ttyHTTPDestination.java:311) at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHT
> TPDestination.java:280) at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandl
> er.java:72) at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.ja
> va:936) at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.jav
> a:873) at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:1
> 17) at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHa
> ndlerCollection.java:247) at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java
> :116) at org.eclipse.jetty.server.Server.handle(Server.java:346)
> at
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:
> 581) at
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnect
> ion.java:1057) at
> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:807) at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214) at
> org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411) at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoin
> t.java:526) at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint
> .java:41) at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java
> :528) at java.lang.Thread.run(Thread.java:662)
>
> > From: safrueh@hotmail.com
> > To: users@cxf.apache.org
> > Subject: jaxb validation
> > Date: Fri, 3 Jun 2011 20:30:40 -0500
> >
> > Upgrading from CXF 2.2.2 to 2.3.4. We have some client software that's
sending the wrong namespace in a request and so we're getting the "Unexpected
wrapper element" fault. I find plenty of discussion in previous posts
suggesting to:
> > set-jaxb-validation-event-handler to "false"
> >
> > Though I've tried a couple of different ways and can't seem to make it
> > work.
> >
> > I've tried compiling it into the service as an annotation.
> >
> > @EndpointProperties({
> >
> > @EndpointProperty(key = "set-jaxb-validation-event-handler",
> > value="false")
> >
> > })
> >
> > I've also tried programatically.
> >
> > final JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
> > final Map<String, Object> properties = svrFactory.getProperties(true);
> > properties.put("set-jaxb-validation-event-handler", Boolean.FALSE);
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com
RE: jaxb validation
Posted by Shane Frueh <sa...@hotmail.com>.
This is the exception I'm getting:
Also, programatically, I tried Boolean.FALSE and "false" as the value for "set-jaxb-validation-event-handler".
2011-06-03 14.30.05.406:WARN :Interceptor for {http://test.vue.com/}TestService#{http://test.vue.com/}getAppointment has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unexpected wrapper element {http://woof.test.vue.com/}getAppointment found. Expected {http://test.vue.com/}getAppointment.
at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:311)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:280)
at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:936)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:873)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:346)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:581)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1057)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:807)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:526)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:41)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:528)
at java.lang.Thread.run(Thread.java:662)
> From: safrueh@hotmail.com
> To: users@cxf.apache.org
> Subject: jaxb validation
> Date: Fri, 3 Jun 2011 20:30:40 -0500
>
>
> Upgrading from CXF 2.2.2 to 2.3.4. We have some client software that's sending the wrong namespace in a request and so we're getting the "Unexpected wrapper element" fault. I find plenty of discussion in previous posts suggesting to:
>
> set-jaxb-validation-event-handler to "false"
>
> Though I've tried a couple of different ways and can't seem to make it work.
>
> I've tried compiling it into the service as an annotation.
>
> @EndpointProperties({
> @EndpointProperty(key = "set-jaxb-validation-event-handler", value="false")
> })
>
> I've also tried programatically.
>
> final JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
> final Map<String, Object> properties = svrFactory.getProperties(true);
> properties.put("set-jaxb-validation-event-handler", Boolean.FALSE);
>
>
>