cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xilai Dai (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5169) the schema-validation-enabled property doesn't work for OUT message validation
Date Mon, 02 Sep 2013 07:30:52 GMT

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

Xilai Dai commented on CXF-5169:
--------------------------------

Retested with attached example service and cxf 2.7.7-SNAPSHOT, but got exceptions when invoke
this service:

{code}
15:21:06,746 | WARN  | qtp625321787-108 | nsport.servlet.ServletController  175 | 130 - org.apache.cxf.cxf-rt-transports-http
- 2.7.7.SNAPSHOT | Can't find the the request for http://localhost:8040/services//'s Observer

15:21:40,539 | WARN  | qtp625321787-107 | nding.source.XMLStreamDataReader  226 | 123 - org.apache.cxf.cxf-rt-core
- 2.7.7.SNAPSHOT | Failed to initialize MSV validator and validate the XMLStream.  Make sure
cxf-wstx-msv-validation and the MSV libraries are found.
15:21:40,665 | WARN  | qtp625321787-107 | ache.cxf.common.logging.LogUtils  452 | 122 - org.apache.cxf.cxf-api
- 2.7.7.SNAPSHOT | Interceptor for {http://www.talend.org/service/}DemoService#{http://www.talend.org/service/}DemoServiceOperation
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused by: org.xml.sax.SAXParseException:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'out'. One of '{out}'
is expected..
	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:99)[123:org.apache.cxf.cxf-rt-core:2.7.7.SNAPSHOT]
	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:54)[123:org.apache.cxf.cxf-rt-core:2.7.7.SNAPSHOT]
	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:48)[123:org.apache.cxf.cxf-rt-core:2.7.7.SNAPSHOT]
	at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:123)[122:org.apache.cxf.cxf-api:2.7.7.SNAPSHOT]
	at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)[122:org.apache.cxf.cxf-api:2.7.7.SNAPSHOT]
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)[122:org.apache.cxf.cxf-api:2.7.7.SNAPSHOT]
	at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)[122:org.apache.cxf.cxf-api:2.7.7.SNAPSHOT]
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)[122:org.apache.cxf.cxf-api:2.7.7.SNAPSHOT]
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[122:org.apache.cxf.cxf-api:2.7.7.SNAPSHOT]
	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)[130:org.apache.cxf.cxf-rt-transports-http:2.7.7.SNAPSHOT]
	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248)[130:org.apache.cxf.cxf-rt-transports-http:2.7.7.SNAPSHOT]
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:222)[130:org.apache.cxf.cxf-rt-transports-http:2.7.7.SNAPSHOT]
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)[130:org.apache.cxf.cxf-rt-transports-http:2.7.7.SNAPSHOT]
	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:167)[130:org.apache.cxf.cxf-rt-transports-http:2.7.7.SNAPSHOT]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)[130:org.apache.cxf.cxf-rt-transports-http:2.7.7.SNAPSHOT]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206)[130:org.apache.cxf.cxf-rt-transports-http:2.7.7.SNAPSHOT]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)[55:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.2]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262)[130:org.apache.cxf.cxf-rt-transports-http:2.7.7.SNAPSHOT]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)[66:org.eclipse.jetty.servlet:7.6.8.v20121106]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:447)[66:org.eclipse.jetty.servlet:7.6.8.v20121106]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)[76:org.ops4j.pax.web.pax-web-jetty:1.1.14]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)[65:org.eclipse.jetty.security:7.6.8.v20121106]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:124)[76:org.ops4j.pax.web.pax-web-jetty:1.1.14]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)[66:org.eclipse.jetty.servlet:7.6.8.v20121106]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:81)[76:org.ops4j.pax.web.pax-web-jetty:1.1.14]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.eclipse.jetty.server.Server.handle(Server.java:363)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:931)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:992)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)[60:org.eclipse.jetty.http:7.6.8.v20121106]
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)[60:org.eclipse.jetty.http:7.6.8.v20121106]
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[64:org.eclipse.jetty.server:7.6.8.v20121106]
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)[59:org.eclipse.jetty.io:7.6.8.v20121106]
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)[59:org.eclipse.jetty.io:7.6.8.v20121106]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[58:org.eclipse.jetty.util:7.6.8.v20121106]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[58:org.eclipse.jetty.util:7.6.8.v20121106]
	at java.lang.Thread.run(Thread.java:722)[:1.7.0_05]
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found
starting with element 'out'. One of '{out}' is expected.
	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.jaxp.validation.DOMValidatorHelper.beginNode(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)[158:org.apache.servicemix.bundles.xerces:2.11.0.1]
	at javax.xml.validation.Validator.validate(Unknown Source)[:2.2.0]
	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:85)[123:org.apache.cxf.cxf-rt-core:2.7.7.SNAPSHOT]
	... 43 more
{code}
                
> the schema-validation-enabled property doesn't work for OUT message validation
> ------------------------------------------------------------------------------
>
>                 Key: CXF-5169
>                 URL: https://issues.apache.org/jira/browse/CXF-5169
>             Project: CXF
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.7.6
>            Reporter: Xilai Dai
>            Assignee: Freeman Fang
>             Fix For: 3.0.0, 2.6.10, 2.7.7
>
>         Attachments: test_validation_service.zip
>
>
> With this configuration: 
> {code}
> <jaxws:endpoint ...>
> ......
>   <jaxws:properties>
>       <entry key="schema-validation-enabled" value="true" />
>   </jaxws:properties>
> </jaxws:endpoint>
> {code}
> then, the schema validation for Request(IN) message works well, but it doesn't take any
effect for Response(OUT) message.
> the schema (from WSDL) piece example which I used is:
> {code}
> <xsd:element name="DemoServiceOperationResponse">
>     <xsd:complexType>
>         <xsd:sequence>
>             <xsd:element name="out">
>                   <xsd:simpleType>
>                        <xsd:restriction base="xsd:string">
>                        <xsd:minLength value="20"></xsd:minLength>
>                        <xsd:maxLength value="30"></xsd:maxLength>
>                        </xsd:restriction>
>                   </xsd:simpleType>
>              </xsd:element>
>         </xsd:sequence>
>     </xsd:complexType>
> </xsd:element>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message