ОШИБКА Axis2Sender Неожиданная ошибка при отправке сообщения org. apache .axis2.AxisFault: Полезная нагрузка не может быть записана как JSON - PullRequest
0 голосов
/ 14 февраля 2020

Можете ли вы помочь мне с моим WSO2
После добавления конфигурации конечной точки я получаю org. apache .axis2.AxisFault: Полезная нагрузка не может быть записана как JSON. Может кто-нибудь, пожалуйста, посмотрите и помогите?

2020-02-13 13:48:51,695 [-] [Timer-9]  WARN EndpointContext Endpoint : admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1_0 with address http://10.0.3.13:28243/orderManagement/v1.0/ is marked as TIMEOUT and will be retried : 1 more time/s after : Thu Feb 13 13:48:56 CET 2020 until its marked SUSPENDED for failure
2020-02-13 13:48:51,696 [-] [Timer-9]  WARN LoadbalanceEndpoint Endpoint [admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1] Detect a Failure in a child endpoint : Endpoint [admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1_0]
2020-02-13 13:48:51,696 [-] [Timer-9] ERROR JsonUtil #writeAsJson. Payload could not be written as JSON. MessageID: urn:uuid:b4217401-12a8-404a-bd2d-2f8001fa0d02
2020-02-13 13:48:51,696 [-] [Timer-9] ERROR Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: Payload could not be written as JSON.
        at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:300)
        at org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:70)
        at org.apache.synapse.transport.passthru.PassThroughHttpSender.sendRequestContent(PassThroughHttpSender.java:421)
        at java.util.TimerThread.run(Timer.java:505)
2020-02-13 13:48:51,698 [-] [Timer-9]  WARN EndpointContext Endpoint : admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1_1 with address http://10.0.3.15:28243/orderManagement/v1.0/ is marked as TIMEOUT and will be retried : 1 more time/s after : Thu Feb 13 13:48:56 CET 2020 until its marked SUSPENDED for failure
2020-02-13 13:48:51,698 [-] [Timer-9]  WARN LoadbalanceEndpoint Endpoint [admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1] Detect a Failure in a child endpoint : Endpoint [admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1_1]
2020-02-13 13:48:51,698 [-] [Timer-9]  WARN LoadbalanceEndpoint Loadbalance endpoint : admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1 - no ready child endpoints
2020-02-13 13:48:51,698 [-] [Timer-9]  WARN admin--OCD-CustomerOrderManagement Executing fault sequence mediator : fault
2020-02-13 13:48:51,699 [-] [Timer-9]  WARN EndpointContext Endpoint : admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1_1 with address http://10.0.3.15:28243/orderManagement/v1.0/ is marked as TIMEOUT and will be retried : 0 more time/s after : Thu Feb 13 13:48:56 CET 2020 until its marked SUSPENDED for failure
2020-02-13 13:48:51,699 [-] [Timer-9]  WARN LoadbalanceEndpoint Endpoint [admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1] Detect a Failure in a child endpoint : Endpoint [admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1_1]
2020-02-13 13:48:51,699 [-] [Timer-9]  WARN LoadbalanceEndpoint Loadbalance endpoint : admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1 - no ready child endpoints
2020-02-13 13:48:51,699 [-] [Timer-9]  WARN admin--OCD-CustomerOrderManagement Executing fault sequence mediator : fault
2020-02-13 13:48:51,700 [-] [Timer-9]  WARN EndpointContext Endpoint : admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1_0 with address http://10.0.3.13:28243/orderManagement/v1.0/ is marked as TIMEOUT and will be retried : 0 more time/s after : Thu Feb 13 13:48:56 CET 2020 until its marked SUSPENDED for failure
2020-02-13 13:48:51,700 [-] [Timer-9]  WARN LoadbalanceEndpoint Endpoint [admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1] Detect a Failure in a child endpoint : Endpoint [admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1_0]
2020-02-13 13:48:51,700 [-] [Timer-9]  WARN LoadbalanceEndpoint Loadbalance endpoint : admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1 - no ready child endpoints
2020-02-13 13:48:51,700 [-] [Timer-9]  WARN admin--OCD-CustomerOrderManagement Executing fault sequence mediator : fault
2020-02-13 13:48:51,700 [-] [Timer-9]  WARN TimeoutHandler Expiring message ID : urn:uuid:0bbdf889-a061-4d98-8ca7-430669a560c4; dropping message after ENDPOINT_TIMEOUT of : 5 seconds for null, URI : http://10.0.3.13:28243/orderManagement/v1.0/productOrder, Received through API : admin--OCD-CustomerOrderManagement:vv1.0
2020-02-13 13:48:51,725 [-] [PassThroughMessageProcessor-368]  WARN SynapseCallbackReceiver Synapse received a response for the request with message Id : urn:uuid:0bbdf889-a061-4d98-8ca7-430669a560c4 But a callback is not registered (anymore) to process this response
2020-02-13 13:48:51,728 [-] [PassThroughMessageProcessor-212]  WARN LoadbalanceEndpoint Loadbalance endpoint : admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1 - no ready child endpoints
2020-02-13 13:48:51,728 [-] [PassThroughMessageProcessor-212]  WARN admin--OCD-CustomerOrderManagement Executing fault sequence mediator : fault
2020-02-13 13:48:51,732 [-] [PassThroughMessageProcessor-163]  WARN SynapseCallbackReceiver Synapse received a response for the request with message Id : urn:uuid:f6841d34-51d3-4748-9eb8-a6dc13dd620a But a callback is not registered (anymore) to process this response
2020-02-13 13:48:51,752 [-] [PassThroughMessageProcessor-289]  WARN LoadbalanceEndpoint Loadbalance endpoint : admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1 - no ready child endpoints
2020-02-13 13:48:51,753 [-] [PassThroughMessageProcessor-289]  WARN admin--OCD-CustomerOrderManagement Executing fault sequence mediator : fault
2020-02-13 13:48:51,755 [-] [PassThroughMessageProcessor-95]  WARN LoadbalanceEndpoint Loadbalance endpoint : admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1 - no ready child endpoints
2020-02-13 13:48:51,756 [-] [PassThroughMessageProcessor-95]  WARN admin--OCD-CustomerOrderManagement Executing fault sequence mediator : fault
2020-02-13 13:48:51,765 [-] [PassThroughMessageProcessor-315]  WARN SynapseCallbackReceiver Synapse received a response for the request with message Id : urn:uuid:eee72c23-3953-4463-ae14-8d525a901455 But a callback is not registered (anymore) to process this response
2020-02-13 13:49:01,695 [-] [Timer-9]  WARN admin--OCD-CustomerOrderManagement Executing fault sequence mediator : fault
2020-02-13 13:49:01,696 [-] [Timer-9]  WARN Axis2Sender Trying to send a response to an already responded client request - Rest API Context : /OCD/customer/v1/orderManagement/v1.0

Моя конфигурация synapse-config выглядит следующим образом:

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse"
     name="admin--OCD-CustomerOrderManagement"
     context="/OCD/customer/v1/orderManagement/v1.0"
     version="v1.0"
     version-type="context">
   <resource methods="GET" url-mapping="/status" faultSequence="fault">
      <inSequence>
         <property name="api.ut.backendRequestTime"
                   expression="get-property('SYSTEM_TIME')"/>
         <filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
            <then>
               <send>
                  <endpoint name="admin--OCD-CustomerOrderManagement_APIproductionEndpoint_0">
                     <loadbalance algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
                        <endpoint name="admin--OCD-CustomerOrderManagement_APIproductionEndpoint_0_0">
                           <http uri-template="http://10.0.3.13:28243/orderManagement/v1.0/">
                              <timeout>
                                 <duration>5000</duration>
                                 <responseAction>fault</responseAction>
                              </timeout>
                              <suspendOnFailure>
                                 <errorCodes>101503,101504,101505,101510</errorCodes>
                                 <initialDuration>10000</initialDuration>
                                 <progressionFactor>1.0</progressionFactor>
                                 <maximumDuration>600000</maximumDuration>
                              </suspendOnFailure>
                              <markForSuspension>
                                 <retriesBeforeSuspension>2</retriesBeforeSuspension>
                                 <retryDelay>5000</retryDelay>
                              </markForSuspension>
                           </http>
                           <property name="ENDPOINT_ADDRESS"
                                     value="http://10.0.3.13:28243/orderManagement/v1.0/"/>
                        </endpoint>
                        <endpoint name="admin--OCD-CustomerOrderManagement_APIproductionEndpoint_0_1">
                           <http uri-template="http://10.0.3.15:28243/orderManagement/v1.0/">
                            <timeout>
                                 <duration>5000</duration>
                                 <responseAction>fault</responseAction>
                              </timeout>
                              <suspendOnFailure>
                                 <errorCodes>101503,101504,101505,101510</errorCodes>
                                 <initialDuration>10000</initialDuration>
                                 <progressionFactor>12.0</progressionFactor>
                                 <maximumDuration>600000</maximumDuration>
                              </suspendOnFailure>
                              <markForSuspension>
                                 <retriesBeforeSuspension>2</retriesBeforeSuspension>
                                 <retryDelay>5000</retryDelay>
                              </markForSuspension>
                           </http>
                           <property name="ENDPOINT_ADDRESS"
                                     value="http://10.0.3.15:28243/orderManagement/v1.0/"/>
                        </endpoint>
                     </loadbalance>
                  </endpoint>
               </send>
            </then>
            <else>
               <sequence key="_sandbox_key_error_"/>
            </else>
         </filter>
      </inSequence>
      <outSequence>
         <class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
         <send/>
      </outSequence>
   </resource>
   <resource methods="POST" url-mapping="/productOrder" faultSequence="fault">
      <inSequence>
 <resource methods="POST" url-mapping="/productOrder" faultSequence="fault">
      <inSequence>
         <property name="api.ut.backendRequestTime"
                   expression="get-property('SYSTEM_TIME')"/>
         <filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
            <then>
               <send>
                  <endpoint name="admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1">
                     <loadbalance algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
                        <endpoint name="admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1_0">
                           <http uri-template="http://10.0.3.13:28243/orderManagement/v1.0/">
                              <timeout>
                                 <duration>5000</duration>
                                 <responseAction>fault</responseAction>
                              </timeout>
                              <suspendOnFailure>
                                 <errorCodes>101503,101504,101505,101510</errorCodes>
                                 <initialDuration>10000</initialDuration>
                                 <progressionFactor>1.0</progressionFactor>
                                 <maximumDuration>600000</maximumDuration>
                              </suspendOnFailure>
                              <markForSuspension>
                                 <retriesBeforeSuspension>2</retriesBeforeSuspension>
                                 <retryDelay>5000</retryDelay>
                              </markForSuspension>
                           </http>
                           <property name="ENDPOINT_ADDRESS"
                                     value="http://10.0.3.13:28243/orderManagement/v1.0/"/>
                        </endpoint>
                        <endpoint name="admin--OCD-CustomerOrderManagement_APIproductionEndpoint_1_1">
<http uri-template="http://10.0.3.15:28243/orderManagement/v1.0/">
                              <timeout>
                                 <duration>5000</duration>
                                 <responseAction>fault</responseAction>
                              </timeout>
                              <suspendOnFailure>
                                 <errorCodes>101503,101504,101505,101510</errorCodes>
                                 <initialDuration>10000</initialDuration>
                                 <progressionFactor>12.0</progressionFactor>
                                 <maximumDuration>600000</maximumDuration>
                              </suspendOnFailure>
                              <markForSuspension>
                                 <retriesBeforeSuspension>2</retriesBeforeSuspension>
                                 <retryDelay>5000</retryDelay>
                              </markForSuspension>
                           </http>
                           <property name="ENDPOINT_ADDRESS"
                                     value="http://10.0.3.15:28243/orderManagement/v1.0/"/>
                        </endpoint>
                     </loadbalance>
                  </endpoint>
               </send>
            </then>
            <else>
               <sequence key="_sandbox_key_error_"/>
            </else>
         </filter>
      </inSequence>
      <outSequence>
         <class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>  <send/>
      </outSequence>
   </resource>
   <handlers>
      <handler class="org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler"/>
      <handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
         <property name="apiImplementationType" value="ENDPOINT"/>
      </handler>
      <handler class="org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler">
         <property name="RemoveOAuthHeadersFromOutMessage" value="true"/>
      </handler>
      <handler class="org.wso2.carbon.apimgt.gateway.handlers.throttling.ThrottleHandler"/>
      <handler class="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtUsageHandler"/>
      <handler class="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtGoogleAnalyticsTrackingHandler">
         <property name="confi`enter code here`gKey" value="gov:/apimgt/statistics/ga-config.xml"/>
      </handler>
      <handler class="org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler"/>
      <handler class="com.orange.lsdp.wso2.custom.log.CustomAPIManagerLogHandler"/>
   </handlers>
</api>

Для любых разъяснений или дополнительной информации, не стесняйтесь спрашивать.

...