XML > 4000 chars published through SimpleURLRegistry gets StackOverflow
-----------------------------------------------------------------------

                 Key: SYNAPSE-440
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-440
             Project: Synapse
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.2
         Environment: WinXP, Java6, Standard Synapse 1.2 binary
            Reporter: Jason Royals


Consider the following config:

{code}
<definitions xmlns="http://ws.apache.org/ns/synapse";>
    <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
        <parameter name="root">file:./repository/conf/registry/</parameter>
        <parameter name="cachableDuration">5000</parameter>
    </registry>
    <proxy name="MyService" transports="http">
        <description>A cool service.</description>
        <target inSequence="mediators/insequence.xml"
                outSequence="mediators/outsequence.xml"
                faultSequence="mediators/faultsequence.xml"
                endpoint="mediators/endpoint.xml"/>

                <publishWSDL key="public-api/service.wsdl"/>
    </proxy>
</definitions>
{code}

If "service.wsdl" is quite small, this config works perfectly.  

Now add to the wsdl some comments, or a new type, or anything such that the 
size of the schema is now > 4000 characters.  Start Synapse and this is what 
you'll get:

{code}
2008-09-09 [main] FATAL ServerManager Synaps startup failed...
java.lang.StackOverflowError
        at 
org.apache.axiom.om.impl.llom.OMNodeImpl.setComplete(OMNodeImpl.java:181)
        at 
org.apache.axiom.om.impl.llom.OMNodeImpl.setComplete(OMNodeImpl.java:181)
        at 
org.apache.axiom.om.impl.llom.OMNodeImpl.setComplete(OMNodeImpl.java:181)
        at 
org.apache.axiom.om.impl.llom.OMNodeImpl.setComplete(OMNodeImpl.java:181)
... and on it goes
{code}

I have a JUnit test which exposes the problem, and sequence of operations to 
make it fail in this way, and will attach to the issue.

Regarding the cause, I did get down and dirty with Axiom and Woodstox and I'm 
still not sure if its the way ProxyService uses Axiom, or if it is how Axiom 
uses Woodstox (which has a 4000 character stream buffer - no coincidence I'm 
sure).  I do know that when the 4000 (or thereabouts) character limit is 
reached, Woodstox seems to start from the top of the WSDL again and Axiom 
processes it all again, and again, and again.  Woodstox doesn't appear to get 
the next "page" of 4000 characters (or maybe it is not being given he 
opportunity) and repeats what it just did again, and so on.  It _only_ happens 
through the SimpleURLRegistry so far as I can tell, by _not_ using the 
SimpleURLRegistry everything seems OK.

Workaround for this is to replace "key" with "uri" in the {{publishWSDL}} 
element and point directly to the wsdl.  It seems that if we don't go through 
SimpleURLRegistry, everything works fine.

Cheers,
Jason

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to