synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Senduran (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SYNAPSE-1005) Validate mediator throws StackOverflowError, when the schema has Cyclic import or include
Date Sat, 04 Jun 2016 18:01:01 GMT

     [ https://issues.apache.org/jira/browse/SYNAPSE-1005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Senduran updated SYNAPSE-1005:
------------------------------
    Attachment: test-case-for-SYNAPSE-1005.diff

Please find the test case for this issue. One thing I would like to point here is, I have
added four new files as the resources to the test case. and I have committed them to the `repository/conf/sample/resources/validate/`
so when the synapse distribution is created these 4 xsd files are also getting shipped. 
So please comment on this.

> Validate mediator throws StackOverflowError, when the schema has Cyclic import or include
> -----------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-1005
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-1005
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>            Reporter: Senduran
>            Assignee: Hiranya Jayathilaka
>              Labels: patch
>             Fix For: 3.0
>
>         Attachments: test-case-for-SYNAPSE-1005.diff, validate_mediator_cyclic_schema_fix.diff
>
>
> sample proxy service 
> {code:xml}
> <proxy xmlns="http://ws.apache.org/ns/synapse" name="validateRequest" transports="http"
startOnLoad="true">
>     <target>
>         <inSequence>
>             <validate>
>                 <schema key="A.xsd"/>
>                 <resource location="B.xsd" key="B.xsd"/>
>                 <resource location="C.xsd" key="C.xsd"/>
>                 <resource location="D.xsd" key="D.xsd"/>
>                 <on-fail>
>                     <makefault version="soap11">
>                         <code xmlns:tns="http://www.w3.org/2003/05/soap-envelope"
value="tns:Receiver"/>
>                         <reason value="Invalid Request!!!"/>
>                         <role/>
>                     </makefault>
>                     <log level="full"/>
>                     <property name="RESPONSE" value="true"/>
>                     <header name="To" action="remove"/>
>                     <send/>
>                     <drop/>
>                 </on-fail>
>             </validate>
>             <property name="RESPONSE" value="true"/>
>             <header name="To" action="remove"/>
>             <send/>
>         </inSequence>
>     </target>
>     <description/>
> </proxy>
> {code}
> Here A includes B, B includes C and  C includes D.
> But say for example if C includes Both D and B there is a cyclic reference. 
> So the following exception will be thrown
> {code}
> java.lang.StackOverflowError
> 	at com.ctc.wstx.sw.BaseStreamWriter.<init>(BaseStreamWriter.java:259)
> 	at com.ctc.wstx.sw.BaseNsStreamWriter.<init>(BaseNsStreamWriter.java:122)
> 	at com.ctc.wstx.sw.SimpleNsStreamWriter.<init>(SimpleNsStreamWriter.java:59)
> 	at com.ctc.wstx.stax.WstxOutputFactory.createSW(WstxOutputFactory.java:275)
> 	at com.ctc.wstx.stax.WstxOutputFactory.createXMLStreamWriter(WstxOutputFactory.java:124)
> 	at org.apache.axiom.util.stax.wrapper.XMLOutputFactoryWrapper.createXMLStreamWriter(XMLOutputFactoryWrapper.java:66)
> 	at org.apache.axiom.util.stax.wrapper.WrappingXMLOutputFactory.createXMLStreamWriter(WrappingXMLOutputFactory.java:90)
> 	at org.apache.axiom.util.stax.dialect.WoodstoxOutputFactoryWrapper.createXMLStreamWriter(WoodstoxOutputFactoryWrapper.java:48)
> 	at org.apache.axiom.util.stax.wrapper.XMLOutputFactoryWrapper.createXMLStreamWriter(XMLOutputFactoryWrapper.java:66)
> 	at org.apache.axiom.om.util.StAXUtils$4.run(StAXUtils.java:364)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.apache.axiom.om.util.StAXUtils.createXMLStreamWriter(StAXUtils.java:360)
> 	at org.apache.axiom.om.util.StAXUtils.createXMLStreamWriter(StAXUtils.java:353)
> 	at org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:130)
> 	at org.apache.synapse.util.resolver.ResourceMap.resolve(ResourceMap.java:93)
> 	at org.apache.synapse.util.jaxp.SchemaResourceResolver.resolveResource(SchemaResourceResolver.java:47)
> 	at org.apache.xerces.util.DOMEntityResolverWrapper.resolveEntity(Unknown Source)
> 	at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
> 	at org.apache.xerces.impl.xs.XMLSchemaLoader.resolveDocument(Unknown Source)
> 	at org.apache.xerces.impl.xs.traversers.XSDHandler.resolveSchema(Unknown Source)
> 	at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
> 	at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
> 	at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message