Hi Chamila,

The reason that error doesn't print prior to the fix seems to be that the
default content-type set as the application/x-www-form-urlencoded and
product distribution ships with the axis2.xml enabling the
relevant builder/formatter for that content-type. Could you try adding
following builder/formatter to axis2.xml and check whether it resolves the
issue?

<messageBuilder contentType="application/octet-stream"
class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
<messageFormatter contentType="application/octet-streaml"
class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>

Thanks.


On Sun, Mar 4, 2018 at 11:13 AM, Chamila Adhikarinayake <chami...@wso2.com>
wrote:

> Hi Vijitha,
>
> Seems like the PR[1] is causing the issue. It sets content-type to
> application/octet-stream for requests without a content-type header.
> Seems like the logic is ok for POST request but not sure why that
> validation related method is called for all other HTTP methods in [2].
>
> [1] https://github.com/wso2/wso2-synapse/pull/1015/files
> [2] https://github.com/wso2/wso2-synapse/blob/master/
> modules/transports/core/nhttp/src/main/java/org/apache/
> synapse/transport/passthru/ServerWorker.java#L155
>
> On Fri, Mar 2, 2018 at 9:14 PM, Vijitha Ekanayake <vijit...@wso2.com>
> wrote:
>
>> ++Chanika
>>
>> On Fri, Mar 2, 2018 at 6:30 PM, Nuwan Dias <nuw...@wso2.com> wrote:
>>
>>> Is there a release of EI happening in Q1? Don't you notice this error on
>>> latest versions of EI?
>>>
>>> On Fri, Feb 23, 2018 at 3:46 PM, Vijitha Ekanayake <vijit...@wso2.com>
>>> wrote:
>>>
>>>> This error is generated within the handleRESTUrlPost(...) method in
>>>> ServerWorker class. So I think we need to investigate the reason why these
>>>> GET requests are landed in that method and fix if there is an issue in the
>>>> logic.
>>>>
>>>> Thanks.
>>>>
>>>> On Fri, Feb 23, 2018 at 3:20 PM, Chaminda Jayawardena <
>>>> chami...@wso2.com> wrote:
>>>>
>>>>> True, But I am trying with Jmeter and just tried since suggested above
>>>>> and error is not appeared when it sends with Content-Type :)
>>>>> Yes, have to fix it.
>>>>>
>>>>> Thanks,
>>>>> Chaminda
>>>>>
>>>>> On Fri, Feb 23, 2018 at 3:12 PM, Nuwan Dias <nuw...@wso2.com> wrote:
>>>>>
>>>>>> Well, for GET requests you aren't supposed to have a Content-Type
>>>>>> header.
>>>>>>
>>>>>> On Fri, Feb 23, 2018 at 3:11 PM, Chaminda Jayawardena <
>>>>>> chami...@wso2.com> wrote:
>>>>>>
>>>>>>> Getting this continuously even for the GET requests in
>>>>>>> wso2apim-2.1.0-update12. Disappeared once put Content-Type(value as any
>>>>>>> format) on the header.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Chaminda
>>>>>>>
>>>>>>> On Fri, Feb 23, 2018 at 1:38 PM, Nuwan Dias <nuw...@wso2.com> wrote:
>>>>>>>
>>>>>>>> I'm just doing a GET. I also checked with a POST with the correct
>>>>>>>> Content-Type header as well.
>>>>>>>>
>>>>>>>> On Fri, Feb 23, 2018 at 1:17 PM, Vijitha Ekanayake <
>>>>>>>> vijit...@wso2.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Nuwan,
>>>>>>>>>
>>>>>>>>> According to below code segment, it seems like this happens when
>>>>>>>>> request Content-Type doesn't match with the payload.
>>>>>>>>>
>>>>>>>>> try {
>>>>>>>>>
>>>>>>>>>   soapEnvelope = TransportUtils.createSOAPMessage(msgContext, null, 
>>>>>>>>> contentType);
>>>>>>>>>    } catch (Exception e) {
>>>>>>>>>   log.error("Error while building message for REST_URL request");
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> Also It might be a case that POST requests received without a 
>>>>>>>>> Content-Type header. Is there any possibility to isolate one such 
>>>>>>>>> request causes this error. So that we could identify extract root 
>>>>>>>>> cause for this.
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Feb 22, 2018 at 2:38 PM, Nuwan Dias <nuw...@wso2.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I'm seeing the error "*ServerWorker Error while building message
>>>>>>>>>> for REST_URL request*" on the logs for all API requests on
>>>>>>>>>> Synapse version 2.1.7.wso2v40. Any idea what could be causing this? 
>>>>>>>>>> AFAIR
>>>>>>>>>> this wasn't there on earlier versions.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> NuwanD.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Nuwan Dias
>>>>>>>>>>
>>>>>>>>>> Software Architect - WSO2, Inc. http://wso2.com
>>>>>>>>>> email : nuw...@wso2.com
>>>>>>>>>> Phone : +94 777 775 729 <+94%2077%20777%205729>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Vijitha Ekanayake
>>>>>>>>> Senior Software Engineer*, *WSO2, Inc.; http://wso2.com/
>>>>>>>>> Mobile : +94 777 24 73 39 | +94 718 74 44 08
>>>>>>>>> lean.enterprise.middleware
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Nuwan Dias
>>>>>>>>
>>>>>>>> Software Architect - WSO2, Inc. http://wso2.com
>>>>>>>> email : nuw...@wso2.com
>>>>>>>> Phone : +94 777 775 729 <+94%2077%20777%205729>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Dev mailing list
>>>>>>>> Dev@wso2.org
>>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Thanks & Regards
>>>>>>>
>>>>>>> *Chaminda Jayawardena*
>>>>>>> Associate Technical Lead - QA
>>>>>>> WSO2 Inc. - http://wso2.com
>>>>>>> +94-77-7725234 <+94%2077%20772%205234>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Nuwan Dias
>>>>>>
>>>>>> Software Architect - WSO2, Inc. http://wso2.com
>>>>>> email : nuw...@wso2.com
>>>>>> Phone : +94 777 775 729 <+94%2077%20777%205729>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thanks & Regards
>>>>>
>>>>> *Chaminda Jayawardena*
>>>>> Associate Technical Lead - QA
>>>>> WSO2 Inc. - http://wso2.com
>>>>> +94-77-7725234 <+94%2077%20772%205234>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Vijitha Ekanayake
>>>> Senior Software Engineer*, *WSO2, Inc.; http://wso2.com/
>>>> Mobile : +94 777 24 73 39 | +94 718 74 44 08
>>>> lean.enterprise.middleware
>>>>
>>>
>>>
>>>
>>> --
>>> Nuwan Dias
>>>
>>> Software Architect - WSO2, Inc. http://wso2.com
>>> email : nuw...@wso2.com
>>> Phone : +94 777 775 729 <+94%2077%20777%205729>
>>>
>>
>>
>>
>> --
>> Vijitha Ekanayake
>> Senior Software Engineer*, *WSO2, Inc.; http://wso2.com/
>> Mobile : +94 777 24 73 39 | +94 718 74 44 08
>> lean.enterprise.middleware
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Regards,
> Chamila Adhikarinayake
> Senior Software Engineer
> WSO2, Inc.
> Mobile - +94712346437 <+94%2071%20234%206437>
> Email  - chami...@wso2.com
> Blog  -  http://helpfromadhi.blogspot.com/
>



-- 
Vijitha Ekanayake
Senior Software Engineer*, *WSO2, Inc.; http://wso2.com/
Mobile : +94 777 24 73 39 | +94 718 74 44 08
lean.enterprise.middleware
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to