synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SYNAPSE-849) Cannot reply or makefault when client sends malformed XML - org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxParsingException
Date Mon, 23 Jun 2014 22:30:27 GMT

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

Andreas Veithen commented on SYNAPSE-849:
-----------------------------------------

What is the type of incoming message? SOAP or POX?

> Cannot reply or makefault when client sends malformed XML - org.apache.axiom.om.OMException:
com.ctc.wstx.exc.WstxParsingException
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-849
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-849
>             Project: Synapse
>          Issue Type: Bug
>          Components: Script mediator
>    Affects Versions: 2.0
>         Environment: Mac OS X 10.7.3 
> Linux version 2.6.18-238.19.1.el5
> (issue not specific to OS/HW - getting on Mac, Linux, Windows)
>            Reporter: Isobel Novak
>              Labels: patch
>             Fix For: 2.0
>
>   Original Estimate: 1,344h
>  Remaining Estimate: 1,344h
>
> When client sends malformed XML to Synapse service, getting "org.apache.axiom.om.OMException:
com.ctc.wstx.exc.WstxParsingException exception" when accessing the payload to parse it/transform
it, etc.
>   
> After this exception is raised, you cannot mediate the message further, or use makefault
to return response to the client.
> Attempting to makefault after hitting this error only returns the same error 'org.apache.axiom.om.OMException:
com.ctc.wstx.exc.WstxParsingException'.  Cannot makefault.
> We want to be able to return a fault response to the client when they send malformed
xml.  How to do this?  
> Right now, when this exception is raised, we can only log a custom text message and drop
the message, but cannot return a fault response.  
> Dropping the message returns 'HTTP 202 Accepted' response, which isn't really the right
response in this case.  We'd like to return fault response or at least HTTP 400 'Bad request'.
> Error details:
> org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was
expecting a close tag for element <tns:VerifyCouponRequest>
>  at [row,col {unknown-source}]: [970,19]
> 	at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:293)
> 	at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:745)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:723)
> 	at org.apache.synapse.mediators.transform.FaultMediator.makePOXFault(FaultMediator.java:201)
> 	at org.apache.synapse.mediators.transform.FaultMediator.mediate(FaultMediator.java:109)
> 	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> 	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:113)
> 	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:168)
> 	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> 	at org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMediator.java:30)
> 	at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:143)
> 	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> 	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:113)
> 	at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:142)
> 	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
> 	at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:135)
> 	at org.apache.axis2.transport.http.util.RESTUtil.processXMLRequest(RESTUtil.java:84)
> 	at org.apache.synapse.transport.nhttp.util.RESTUtil.processPOSTRequest(RESTUtil.java:184)
> 	at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:403)
> 	at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:259)
> 	at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:58)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:680)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag
for element <tns:VerifyCouponRequest>
>  at [row,col {unknown-source}]: [970,19]
> 	at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> 	at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2730)
> 	at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
> 	at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
> 	at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
> 	at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
> 	at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:672)
> 	at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:676)
> 	at org.apache.axiom.om.impl.llom.OMNodeImpl.getNextOMSibling(OMNodeImpl.java:122)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:344)
> 	at org.apache.axiom.om.impl.traverse.OMChildrenIterator.next(OMChildrenIterator.java:102)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:952)
> 	at org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:125)
> 	at org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:113)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1088)
> 	at org.apache.bsf.xml.DefaultXMLHelper.toScriptXML(DefaultXMLHelper.java:50)
> 	at org.apache.synapse.mediators.bsf.ScriptMessageContext.getPayloadXML(ScriptMessageContext.java:77)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
> 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
> 	at groovy.lang.MetaClassImpl$GetBeanMethodMetaProperty.getProperty(MetaClassImpl.java:3463)
> 	at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:61)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
> 	at Script1.inMediator(Script1.groovy:61)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
> 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1053)
> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:920)
> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:883)
> 	at groovy.lang.Closure.call(Closure.java:410)
> 	at com.sun.script.groovy.GroovyScriptEngine.callGlobal(GroovyScriptEngine.java:294)
> 	at com.sun.script.groovy.GroovyScriptEngine.callGlobal(GroovyScriptEngine.java:288)
> 	at com.sun.script.groovy.GroovyScriptEngine.invokeImpl(GroovyScriptEngine.java:277)
> 	at com.sun.script.groovy.GroovyScriptEngine.invokeFunction(GroovyScriptEngine.java:128)
> 	at org.apache.synapse.mediators.bsf.ScriptMediator.mediateWithExternalScript(ScriptMediator.java:233)
> 	at org.apache.synapse.mediators.bsf.ScriptMediator.invokeScript(ScriptMediator.java:199)
> 	at org.apache.synapse.mediators.bsf.ScriptMediator.mediate(ScriptMediator.java:174)
> 	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> 	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:113)
> 	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:168)
> 	... 13 more



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message