wso2 api manager content-length issue

1.6k views Asked by At

I'm using WSO2 API MANAGER version 1.10.0. I have a issue related Content-Length setting. there are two api.
one api have 411 error (required Content-Length) then I set below property in passthru-http.properties file.

http.headers.preserve=Content-Length

after that 411 error solved. but another api occurring exception.

TID: [-1] [] [2016-12-23 16:11:18,946] ERROR         {org.apache.synapse.transport.passthru.SourceHandler} -  Content-Length header already present {org.apache.synapse.transport.passthru.SourceHandler}
org.apache.http.ProtocolException: Content-Length header already present
at org.apache.http.protocol.ResponseContent.process(ResponseContent.java:101)
at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:139)
at org.apache.synapse.transport.passthru.SourceResponse.start(SourceResponse.java:170)
at org.apache.synapse.transport.passthru.SourceHandler.responseReady(SourceHandler.java:193)
at org.apache.http.impl.nio.DefaultNHttpServerConnection.produceOutput(DefaultNHttpServerConnection.java:305)
at org.apache.synapse.transport.http.conn.LoggingNHttpServerConnection.produceOutput(LoggingNHttpServerConnection.java:114)
at org.apache.synapse.transport.passthru.ServerIODispatch.onOutputReady(ServerIODispatch.java:87)
at org.apache.synapse.transport.passthru.ServerIODispatch.onOutputReady(ServerIODispatch.java:39)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:150)
at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:180)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:586)
at java.lang.Thread.run(Thread.java:745)

As a result, the two APIs can not run concurrently due to Content-Length configuration.

ps.

I saw below url.

WSO2 API Manager 1.10 issue

I modified main.xml in /repository/deployment/server/synapse-configs/default/sequences folder

it's not working for me.

1

There are 1 answers

0
Bee On BEST ANSWER

You can disable chunking globally by 2 methods.

1) Edit velocity template file and add this.

<property name="DISABLE_CHUNKING" value="true" scope="axis2"/> 

See this blog on how to do that.

2) Add a new mediation sequence. See this.