I have a proxy that calls another local proxy in WSO2 ESB 4.6.0.
Basically, the definition is:
<proxy name="Proxy1" >
<target>
<inSequence>
<xslt/>
<header name="Action" value="issueActivity" />
<send>
<endpoint>
<address uri="http://localhost:8280/services/Proxy2" format="soap11"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<filter xpath="not(get-property('FAULT'))">
<xslt/>
</filter>
<send />
</outSequence>
</target>
</proxy>
<proxy name="Proxy2">
<target>
<inSequence>
<xslt />
<property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
<send>
<endpoint key="Inbound" />
</send>
</inSequence>
<outSequence>
<filter xpath="get-property('FAULT')">
<then>
<sequence key="DefaultErrorSequence" />
<header name="To" action="remove" />
</then>
<else>
<property name="Content-Encoding" scope="transport" action="remove"/>
<xslt/>
</else>
</filter>
<send />
</outSequence>
</target>
</proxy>
In almost all calls, the flows works perfectly but, periodically, this error appears in the log when Proxy1 try to call Proxy2:
TID: [0] [ESB] TID: [0] [ESB] [2014-05-08 12:03:35,431] WARN {org.apache.synapse.transport.passthru.TargetHandler} - Receiving response while the handler is in an inconsistent state REQUEST_HEAD
TID: [0] [ESB] TID: [0] [ESB] [2014-05-08 12:03:35,432] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} - Error while building Passthrough stream
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
[...]
At the end of the error in the log:
TID: [0] [ESB] TID: [0] [ESB] [2014-05-08 12:04:35,435] WARN {org.apache.synapse.transport.passthru.TargetHandler} - Connection time out while in state: REQUEST_DONE
TID: [0] [ESB] TID: [0] [ESB] [2014-05-08 12:04:35,436] WARN {org.apache.synapse.FaultHandler} - ERROR_CODE : 101507
TID: [0] [ESB] TID: [0] [ESB] [2014-05-08 12:04:35,436] WARN {org.apache.synapse.FaultHandler} - ERROR_MESSAGE : Error in Sender
TID: [0] [ESB] TID: [0] [ESB] [2014-05-08 12:04:35,437] WARN {org.apache.synapse.FaultHandler} - ERROR_DETAIL : Error in Sender
TID: [0] [ESB] TID: [0] [ESB] [2014-05-08 12:04:35,437] WARN {org.apache.synapse.FaultHandler} - ERROR_EXCEPTION : null
According the WSO2 documentation, the error 101507 means Connection canceled.
The question is what the cause of this error? It's a problem with client or server?
UPDATE
Aparently, the cause of the error is the same described in this question: WSO2 ESB unknown error code 102511
Have you make Return Request Status checkbox enable at operation section while writing query? This may cause the problem..Try it..
To sum up the all comments so far, I think first achievement was that the problem was solved when instead of Proxy1->Proxy2 architecture, changing the Proxy2 to sequences and call them with Sequence mediator instead of invoking them with send mediator removes the errors previously has been shown.
That worked properly but since we need to have the Proxy1->Proxy2 architecture, I think defining the "outSequence" of Proxy1 as receiving sequence in "inSequence" of Proxy1 and sending it to Proxy2 using Send mediator with Proxy2 endpoint would be the solution.
Related
I am trying to show a simple flashing animation in WebAssembly using VisualStates and Storyboards. I am getting the following exception when adding both a Duration and RepeatBehavior='Forever' to a Storyboard:
Error
at 631680 (dotnet.js:1)
at _emscripten_asm_const_iii (dotnet.js:1)
at wasm_logger (:58006/<anonymous>:wasm-function[3132]:0x9dfb7)
at eglib_log_adapter (:58006/<anonymous>:wasm-function[6071]:0x112d92)
at monoeg_g_logstr (:58006/<anonymous>:wasm-function[4608]:0xcd55a)
at monoeg_g_logv_nofree (:58006/<anonymous>:wasm-function[2196]:0x63d92)
at monoeg_assertion_message (:58006/<anonymous>:wasm-function[429]:0xd35c)
at mono_assertion_message_unreachable (:58006/<anonymous>:wasm-function[144]:0x347c)
at interp_exec_method (:58006/<anonymous>:wasm-function[1380]:0x2fa40)
at interp_runtime_invoke (:58006/<anonymous>:wasm-function[5695]:0xfb19a)
Uno.UI.js:97 Unhandled dispatcher exception: RuntimeError: abort(undefined). Build with -s ASSERTIONS=1 for more info. (RuntimeError: abort(undefined). Build with -s ASSERTIONS=1 for more info.
at abort (http://localhost:58006/package_e0b2677001d484af549b92b1436e81abf6d3eb6b/dotnet.js:1:16059)
at _abort (http://localhost:58006/package_e0b2677001d484af549b92b1436e81abf6d3eb6b/dotnet.js:1:117947)
at wasm_logger (<anonymous>:wasm-function[3132]:0x9dfd9)
at eglib_log_adapter (<anonymous>:wasm-function[6071]:0x112d92)
at monoeg_g_logstr (<anonymous>:wasm-function[4608]:0xcd55a)
at monoeg_g_logv_nofree (<anonymous>:wasm-function[2196]:0x63d92)
at monoeg_assertion_message (<anonymous>:wasm-function[429]:0xd35c)
at mono_assertion_message_unreachable (<anonymous>:wasm-function[144]:0x347c)
at interp_exec_method (<anonymous>:wasm-function[1380]:0x2fa40)
at interp_runtime_invoke (<anonymous>:wasm-function[5695]:0xfb19a))
Uno.UI.js:98 Uncaught RuntimeError: abort(undefined). Build with -s ASSERTIONS=1 for more info.
at abort (http://localhost:58006/package_e0b2677001d484af549b92b1436e81abf6d3eb6b/dotnet.js:1:16059)
at _abort (http://localhost:58006/package_e0b2677001d484af549b92b1436e81abf6d3eb6b/dotnet.js:1:117947)
at wasm_logger (<anonymous>:wasm-function[3132]:0x9dfd9)
at eglib_log_adapter (<anonymous>:wasm-function[6071]:0x112d92)
at monoeg_g_logstr (<anonymous>:wasm-function[4608]:0xcd55a)
at monoeg_g_logv_nofree (<anonymous>:wasm-function[2196]:0x63d92)
at monoeg_assertion_message (<anonymous>:wasm-function[429]:0xd35c)
at mono_assertion_message_unreachable (<anonymous>:wasm-function[144]:0x347c)
at interp_exec_method (<anonymous>:wasm-function[1380]:0x2fa40)
at interp_runtime_invoke (<anonymous>:wasm-function[5695]:0xfb19a)
Uno.UI.js:97 Unhandled dispatcher exception: RuntimeError: memory access out of bounds (RuntimeError: memory access out of bounds
at malloc (<anonymous>:wasm-function[359]:0xa47e)
at monoeg_malloc (<anonymous>:wasm-function[161]:0x3e0f)
at mono_mempool_new_size (<anonymous>:wasm-function[629]:0x12bce)
at generate (<anonymous>:wasm-function[5909]:0x107b81)
at mono_interp_transform_method (<anonymous>:wasm-function[1290]:0x2b57b)
at do_transform_method (<anonymous>:wasm-function[2959]:0x93ac4)
at interp_exec_method (<anonymous>:wasm-function[1380]:0x2eda7)
at interp_runtime_invoke (<anonymous>:wasm-function[5695]:0xfb19a)
at mono_jit_runtime_invoke (<anonymous>:wasm-function[5149]:0xe196b)
at do_runtime_invoke (<anonymous>:wasm-function[1411]:0x3ea94))
Uno.UI.js:98 Uncaught RuntimeError: memory access out of bounds
at malloc (<anonymous>:wasm-function[359]:0xa47e)
at monoeg_malloc (<anonymous>:wasm-function[161]:0x3e0f)
at mono_mempool_new_size (<anonymous>:wasm-function[629]:0x12bce)
at generate (<anonymous>:wasm-function[5909]:0x107b81)
at mono_interp_transform_method (<anonymous>:wasm-function[1290]:0x2b57b)
at do_transform_method (<anonymous>:wasm-function[2959]:0x93ac4)
at interp_exec_method (<anonymous>:wasm-function[1380]:0x2eda7)
at interp_runtime_invoke (<anonymous>:wasm-function[5695]:0xfb19a)
at mono_jit_runtime_invoke (<anonymous>:wasm-function[5149]:0xe196b)
at do_runtime_invoke (<anonymous>:wasm-function[1411]:0x3ea94)
dotnet.js:1 Thread 0x1 may have been prematurely finalized* Assertion at /__w/1/s/mono/mono/utils/mono-threads.c:702, condition `<disabled>' not met
Uno.UI.js:97 Unhandled dispatcher exception: [object Object] (undefined)
Uno.UI.js:98 Uncaught ExitStatus {name: "ExitStatus", message: "Program terminated with exit(0)", status: 0}
dotnet.js:1 * Assertion: should not be reached at /__w/1/s/mono/mono/utils/mono-threads-coop.h:48
dotnet.js:1 Uncaught ExitStatus {name: "ExitStatus", message: "Program terminated with exit(0)", status: 0}
dotnet.js:1 * Assertion at /__w/1/s/mono/mono/utils/mono-internal-hash.c:47, condition `<disabled>' not met
dotnet.js:1 Uncaught ExitStatus {name: "ExitStatus", message: "Program terminated with exit(0)", status: 0}
The xaml causing the above error is:
<Grid Background="White" BorderBrush="Gray" BorderThickness="1" Width="250" Height="250">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="LightStates">
<VisualState x:Name="LightFlashing">
<Storyboard Duration="0:0:2.0" RepeatBehavior="Forever">
<DoubleAnimation From="1" To="0" Storyboard.TargetName="AnimatedEllipse" Storyboard.TargetProperty="Opacity" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Ellipse x:Name="AnimatedEllipse" Height="126" Width="126">
<Ellipse.Fill>
<SolidColorBrush x:Name="AnimatedEllipseBrush" Color="Red" />
</Ellipse.Fill>
</Ellipse>
</Grid>
Removing Duration from the Storyboard and adding it to DoubleAnimation is working correctly, no errors. Uno.Wasm.Bootstrap version is 1.3.0-dev.44
This is a bug in Uno Platform, I have created an issue for it on GitHub. The same problem presumably appears on all targets, the workaround before it is fixed is, as you mentioned, to keep the Duration attribute on the DoubleAnimation. Thanks for reporting it!
When I try to use call mediator within the sequence with blocking="true" its throwing an error while send mediator is working properly. Can someone please highlight where i am wrong.
I am using WSO2 APIM 2.6.0
Code:
<call blocking="true">
<endpoint>
<http method="get" uri-template="http://10.10.10.10:10/XYZ/rest/1.0/abc/{uri.var.userId}"/>
</endpoint>
</call>
<respond/>
I am getting below error message:
INFO {org.apache.axis2.transport.http.HTTPSender} - Unable to sendViaGet to url[http://10.10.10.10:10/XYZ/rest/1.0/abc/USERX] {org.apache.axis2.transport.http.HTTPSender}
org.apache.axis2.AxisFault: Transport error: 404 Error:
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:371)
at org.apache.axis2.transport.http.HTTPSender.sendViaGet(HTTPSender.java:109)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:63)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:459)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:286)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:441)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:227)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.sendReceive(BlockingMsgSender.java:490)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.send(BlockingMsgSender.java:382)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:88)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:85)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:547)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:384)
at org.apache.synapse.endpoints.HTTPEndpoint.send(HTTPEndpoint.java:85)
at org.apache.synapse.mediators.builtin.CallMediator.handleBlockingCall(CallMediator.java:164)
at org.apache.synapse.mediators.builtin.CallMediator.mediate(CallMediator.java:119)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMediator.java:37)
at org.apache.synapse.config.xml.SwitchCase.mediate(SwitchCase.java:69)
at org.apache.synapse.mediators.filters.SwitchMediator.mediate(SwitchMediator.java:134)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:169)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.mediate(APIManagerExtensionHandler.java:66)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.handleRequest(APIManagerExtensionHandler.java:75)
at org.apache.synapse.rest.API.process(API.java:325)
Try adding this before the call mediator.
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"/>
I am consuming messages and then passing them on to a taskexecutor.. My MessageListener will instantiate a SimpleMessageListenerContainer Bean which in turn will instantiate other beans(consumer etc).
When I start the tomcat server and post a message the SimpleMessageListenerContainer bean is getting invoked correctly but when in the same queue I post another message I see RabbitListenerEndpointContainer is getting called. As a result, my other beans are not getting set. I get the message but MDB is not invoked.
When I post a message in a different queue (without restart) it works as expected.
I see no exceptions saying the listener is shutdown etc. Is there a property I am missing?
The only thing I can think of is the first message is not formed correctly resulting into some problem.
My Container Bean
<bean id="springListenerContainerCSWF"
class="org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer">
<property name="connectionFactory" ref="cachingConnectionFactory" />
<property name="queues" ref="rabbitDestinationCSWF" />
<property name="messageListener" ref="rabbitMessageListenerCSWF" />
</bean>
Here is the log snippet for first and second message:
Message 1 Log:
DEBUG org.springframework.amqp.rabbit.listener.BlockingQueueConsumer - Storing delivery for consumerTag: 'amq.ctag-Kidy_yvO5xOLL6_7SyuzBw' with deliveryTag: '1' in Consumer#1617944b: tags=[[amq.ctag-Kidy_yvO5xOLL6_7SyuzBw]], channel=Cached Rabbit Channel: AMQChannel(amqp://poc#10.165.1.11:5672/POC,2), conn: Proxy#58651bd2 Shared Rabbit Connection: SimpleConnection#1576020a [delegate=amqp://poc#10.165.1.11:5672/POC, localPort= 61774], acknowledgeMode=AUTO local queue size=0
18:44:29.704 [springListenerContainerABCD_ORDER-1] DEBUG org.springframework.amqp.rabbit.listener.BlockingQueueConsumer - Received message: (Body:'[B#3ac56714(byte[16757])' MessageProperties [headers={timestamp_in_ms=1570626869268}, timestamp=Wed Oct 09 18:44:29 IST 2019, contentLength=0, receivedDeliveryMode=NON_PERSISTENT, redelivered=false, receivedExchange=, receivedRoutingKey=Q.CSW.ABCD_PRODORDER.XYZ, deliveryTag=1, consumerTag=amq.ctag-Kidy_yvO5xOLL6_7SyuzBw, consumerQueue=Q.CSW.ABCD_PRODORDER.XYZ])
18:44:29.704 [springListenerContainerCSWF_ORDER-1] INFO
com.dell.ctm.queue.rabbitmessaging.RabbitMQListener - Received message for consumer: salesOrderConsumer
1
8:44:29.704 [springListenerContainerABCD_ORDER-1] DEBUG com.dell.ctm.queue.rabbitmessaging.RabbitMQListener - Message :: Some Message
Message 2 Log:
DEBUG org.springframework.amqp.rabbit.listener.BlockingQueueConsumer - Storing delivery for consumerTag: 'amq.ctag-LDAzqxJDNlI-zjXQz0iiiQ' with deliveryTag: '1' in Consumer#568eb60e: tags=[[amq.ctag-LDAzqxJDNlI-zjXQz0iiiQ]], channel=Cached Rabbit Channel: AMQChannel(amqp://poc#10.161.1.11:5672/POC,7), conn: Proxy#58651bd2 Shared Rabbit Connection: SimpleConnection#1576020a [delegate=amqp://poc#10.165.1.11:5672/POC, localPort= 61774], acknowledgeMode=AUTO local queue size=0
18:46:53.954 [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer#0-1] DEBUG org.springframework.amqp.rabbit.listener.BlockingQueueConsumer - Received message: (Body:'[B#21865b3b(byte[16757])' MessageProperties [headers={timestamp_in_ms=1570627013570}, timestamp=Wed Oct 09 18:46:53 IST 2019, contentLength=0, receivedDeliveryMode=NON_PERSISTENT, redelivered=false, receivedExchange=, receivedRoutingKey=Q.CSW.ABCD_PRODORDER.XYZ, deliveryTag=1, consumerTag=amq.ctag-LDAzqxJDNlI-zjXQz0iiiQ, consumerQueue=Q.CSW.ABCD_PRODORDER.XYZ])
18:46:54.018 [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer#0-1] DEBUG org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter - Processing [GenericMessage [payload=byte[16757], headers={amqp_receivedDeliveryMode=NON_PERSISTENT, amqp_receivedRoutingKey=Q.CSW.ABCD_PRODORDER.XYZ, timestamp_in_ms=1570627013570, amqp_deliveryTag=1, amqp_timestamp=Wed Oct 09 18:46:53 IST 2019, amqp_consumerQueue=Q.CSW.ABCD_PRODORDER.XYZ, amqp_redelivered=false, id=f55d83d9-88c0-6105-2d02-95e32ac5e57b, amqp_consumerTag=amq.ctag-LDAzqxJDNlI-zjXQz0iiiQ, timestamp=1570627014018}]]
18:46:54.034 [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer#0-1] INFO com.dell.ctm.queue.rabbitmessaging.RabbitMQListener - Received message for consumer: null
18:46:54.034 [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer#0-1] DEBUG com.dell.ctm.queue.rabbitmessaging.RabbitMQListener - Message :: Some Message
This is my connection factory
<bean id="rabbitListenerContainerFactory"
class="org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory">
<property name="connectionFactory">
<ref bean="cachingConnectionFactory" />
</property>
<property name="concurrentConsumers" value="50" />
<property name="maxConcurrentConsumers" value="100" />
<property name="startConsumerMinInterval" value="3000" />
</bean>
I have a simple web service, ws1, that just has a setBody to "hello world" which is exposed by netty. I want to call this web service asynchronously with the help of camel-ahc.
for doing that, I have a main camel context that call the ws1 every 6 seconds, but after calling ws1 in another thread, the control of the program is not returning to the main camel context thread and it seems camel-ahc component is not working and after 60 seconds a request timeout exception is happening.
in my pom i have added:
camel-ahc
camel-reactive-streams
<camelContext trace="true" id="mainCamelContext" xmlns="http://camel.apache.org/schema/blueprint" >
<route id="ahc-route-first-api">
<from uri="timer://webinar?period=6000"/>
<log message="this is body: ${body}"/>
<to uri="ahc:http://192.168.100.232:9999/ws1"/>
<log message="this is body after call: ${body}"/>
</route>
</camelContext>
when install bundle in Fuse:
10:35:18.914 INFO [Camel (mainCamelContext) thread #316 -
timer://webinar] this is body: 10:35:18.914 INFO [Camel
(mainCamelContext) thread #316 - timer://webinar]
ID-localhost-localdomain-1552973873885-38-116 >>>
(ahc-route-first-api) log[this is body: ${body}] -->
ahc://http://192.168.100.232:9999/api?throwExceptionOnFailure=false
<<< Pattern:InOnly,
Headers:{breadcrumbId=ID-localhost-localdomain-1552973873885-38-116,
firedTime=Sat Apr 06 10:35:18 IRDT 2019}, BodyType:null, Body:[Body is
null] 10:35:19.202 WARN [AsyncHttpClient-timer-87-1] Error processing
exchange. Exchange[ID-localhost-localdomain-1552973873885-38-114].
Caused by: [java.util.concurrent.TimeoutException - Request timeout to
192.168.100.232/192.168.100.232:9999 after 60000 ms] java.util.concurrent.TimeoutException: Request timeout to
192.168.100.232/192.168.100.232:9999 after 60000 ms at org.asynchttpclient.netty.timeout.TimeoutTimerTask.expire(TimeoutTimerTask.java:43)
[1990:wrap_file__home_ossl_.m2_repository_org_asynchttpclient_async-http-client_2.4.3_async-http-client-2.4.3.jar_Export-Package_org.asynchttpclient.__version_2.4.3:0.0.0]
at
org.asynchttpclient.netty.timeout.RequestTimeoutTimerTask.run(RequestTimeoutTimerTask.java:50)
[1990:wrap_file__home_ossl_.m2_repository_org_asynchttpclient_async-http-client_2.4.3_async-http-client-2.4.3.jar_Export-Package_org.asynchttpclient.__version_2.4.3:0.0.0]
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:663)
[654:io.netty.common:4.1.16.Final-redhat-2] at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:738)
[654:io.netty.common:4.1.16.Final-redhat-2] at
io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:466)
[654:io.netty.common:4.1.16.Final-redhat-2] at
io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
[654:io.netty.common:4.1.16.Final-redhat-2] at
java.lang.Thread.run(Thread.java:748) [?:?] 10:35:19.203 ERROR
[AsyncHttpClient-timer-87-1] Failed delivery for (MessageId:
ID-localhost-localdomain-1552973873885-38-117 on ExchangeId:
ID-localhost-localdomain-1552973873885-38-114). Exhausted after
delivery attempt: 1 caught: java.util.concurrent.TimeoutException:
Request timeout to 192.168.100.232/192.168.100.232:9999 after 60000 ms
I'm using WSO2 APIManager 1.10.
I'd like to call api request using mediation like this.
<sequence name="loadbalancer_bycompany" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property expression="get-property('transport', 'company')"
name="company" scope="default" type="STRING"/>
<property name="POST_TO_URI" scope="axis2" type="STRING" value="true"/>
<switch source="$trp:company">
<case regex="sds">
<send>
<endpoint>
<address trace="disable" uri="https://70.30.182.167:8243/calc/1.0/"/>
</endpoint>
</send>
</case>
<case regex="etc">
<send>
<endpoint>
<address trace="disable" uri="https://70.30.182.167:9443/calc/1.0/"/>
</endpoint>
</send>
</case>
<default>
<send>
<endpoint>
<address trace="disable" uri="https://70.30.182.167:9443/carbon/"/>
</endpoint>
</send>
</default>
</switch>
</sequence>
So,I tried to set mediator and then i called api.
But, I got sometimes error response that is code 900902 missing credential,
sometimes got right response.
At that time, I found logs like this.
TID: [-1234] [] [2017-02-03 10:45:10,728] INFO {org.apache.synapse.mediators.builtin.LogMediator} - STATUS = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = Access-Control-Allow-Headers:authorization,Access-Control-Allow-Origin,Content-Type,company,Access-Control-Allow-Methods:GET,Access-Control-Allow-Origin:*,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body/></soapenv:Envelope> Unexpected error sending message back {org.apache.synapse.mediators.builtin.LogMediator}
TID: [-1234] [] [2017-02-03 10:45:10,735] ERROR {org.apache.synapse.transport.passthru.PassThroughHttpSSLSender} - Failed to submit the response {org.apache.synapse.transport.passthru.PassThroughHttpSSLSender}
java.lang.NullPointerException
at org.apache.synapse.transport.passthru.util.SourceResponseFactory.create(SourceResponseFactory.java:64)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:462)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:267)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:212)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:493)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:155)
at org.apache.synapse.mediators.MediatorFaultHandler.onFault(MediatorFaultHandler.java:86)
at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:102)
at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:108)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:534)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:251)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
TID: [-1234] [] [2017-02-03 10:45:10,738] ERROR {org.apache.synapse.core.axis2.Axis2Sender} - Access-Control-Allow-Headers:authorization,Access-Control-Allow-Origin,Content-Type,company,Access-Control-Allow-Methods:GET,Access-Control-Allow-Origin:*,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><am:fault xmlns:am="http://wso2.org/apimanager"><am:code>0</am:code><am:type>Status report</am:type><am:message>Runtime Error</am:message><am:description>Access-Control-Allow-Headers:authorization,Access-Control-Allow-Origin,Content-Type,company,Access-Control-Allow-Methods:GET,Access-Control-Allow-Origin:*,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body/></soapenv:Envelope> Unexpected error sending message back</am:description></am:fault></soapenv:Body></soapenv:Envelope> Unexpected error sending message back {org.apache.synapse.core.axis2.Axis2Sender}
org.apache.axis2.AxisFault: Failed to submit the response
at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:610)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:269)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:212)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:493)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:155)
at org.apache.synapse.mediators.MediatorFaultHandler.onFault(MediatorFaultHandler.java:86)
at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:102)
at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:108)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:534)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:251)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.apache.synapse.transport.passthru.util.SourceResponseFactory.create(SourceResponseFactory.java:64)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:462)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:267)
... 18 more
TID: [-1234] [] [2017-02-03 10:45:10,740] ERROR {org.apache.axis2.transport.base.threads.NativeWorkerPool} - Uncaught exception {org.apache.axis2.transport.base.threads.NativeWorkerPool}
java.lang.RuntimeException: org.apache.synapse.SynapseException: Access-Control-Allow-Headers:authorization,Access-Control-Allow-Origin,Content-Type,company,Access-Control-Allow-Methods:GET,Access-Control-Allow-Origin:*,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><am:fault xmlns:am="http://wso2.org/apimanager"><am:code>0</am:code><am:type>Status report</am:type><am:message>Runtime Error</am:message><am:description>Access-Control-Allow-Headers:authorization,Access-Control-Allow-Origin,Content-Type,company,Access-Control-Allow-Methods:GET,Access-Control-Allow-Origin:*,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body/></soapenv:Envelope> Unexpected error sending message back</am:description></am:fault></soapenv:Body></soapenv:Envelope> Unexpected error sending message back
at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:110)
at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:108)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:534)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:251)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.synapse.SynapseException: Access-Control-Allow-Headers:authorization,Access-Control-Allow-Origin,Content-Type,company,Access-Control-Allow-Methods:GET,Access-Control-Allow-Origin:*,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><am:fault xmlns:am="http://wso2.org/apimanager"><am:code>0</am:code><am:type>Status report</am:type><am:message>Runtime Error</am:message><am:description>Access-Control-Allow-Headers:authorization,Access-Control-Allow-Origin,Content-Type,company,Access-Control-Allow-Methods:GET,Access-Control-Allow-Origin:*,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body/></soapenv:Envelope> Unexpected error sending message back</am:description></am:fault></soapenv:Body></soapenv:Envelope> Unexpected error sending message back
at org.apache.synapse.core.axis2.Axis2Sender.handleException(Axis2Sender.java:247)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:215)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:493)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:155)
at org.apache.synapse.mediators.MediatorFaultHandler.onFault(MediatorFaultHandler.java:86)
at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:102)
... 9 more
Caused by: org.apache.axis2.AxisFault: Failed to submit the response
at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:610)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:269)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:212)
... 16 more
Caused by: java.lang.NullPointerException
at org.apache.synapse.transport.passthru.util.SourceResponseFactory.create(SourceResponseFactory.java:64)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:462)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:267)
... 18 more
TID: [-1234] [] [2017-02-03 10:45:59,370] INFO {org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageHandler} - Stat is not enabled {org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageHandler}
TID: [-1234] [] [2017-02-03 10:45:59,374] INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: /calc/1.0/subtract?x=3&y=1, MessageID: urn:uuid:8f4000dc-b878-4d5f-b310-f0129f2db0a3, Direction: request, INFO = https://70.30.182.167:8243/calc/1.0/, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body/></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}
TID: [-1234] [] [2017-02-03 10:45:59,390] INFO {org.wso2.carbon.apimgt.usage.publisher.APIMgtResponseHandler} - Stat is not enabled {org.wso2.carbon.apimgt.usage.publisher.APIMgtResponseHandler}
TID: [-1234] [] [2017-02-03 10:45:59,395] WARN {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler} - API authentication failure due to Missing Credentials {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler}
I found this logs repeatedly, so I i made an effort to fix it.
First of all, to remove this error,
NullPointerException
SourceResponseFactory.create(SourceResponseFactory.java:64)
I figured out code issue in PassThroughHttpSender.java that didn't handle with null case for sourceRequest. And then I found that issue was fixed
wso2-synapse
ESBJAVA-3770 Message size based filtering to prevent OOM. (#679)
https://github.com/wso2/wso2-synapse/commit/1aff92c4bad968f78cf38577cbb7c01516475217
So, I added that code into our codes.
And then NullPointException was disappeared.
And then I tried to remove missing credential error.
So I found this link.
Authorization Bearer in URL Request using WSO2 API Manager
And I tried to set configure like below link.
https://docs.wso2.com/display/AM1100/Writing+Custom+Handlers
And then Missing credential error was removed.
And then result is right response.
But I found below log infinitely
TID: [-1234] [] [2017-02-08 13:20:12,563] WARN {org.wso2.carbon.apimgt.gateway.handlers.throttling.APIThrottleHandler} - No authentication context information found on the request - Throttling not applied {org.wso2.carbon.apimgt.gateway.handlers.throttling.APIThrottleHandler}
I tried to debug SourceHandler and TargetHandler.
and I think connection was created infinitely and wasn't closed all.
I don't know what to do anymore.
So please let me know what I have to do.
Please go through the sample implementation provided in docs. Based on the APIThrottleHandler implementation, this warning message would appear if you haven't set the user context within your custom Auth handler. Please check how the default "OAuthAuthenticator" has been written and how the AuthenticationContext getting initialized. You need to do a similar implementation to your custom handler if need to work with throttling.