Skip to Content
avatar image
Former Member

Urgent:Rest Receiver Custom Error Handling not getting triggered connection refused by Rest API

Hi Experts,

Could you please help urgently as we are facing issue in production frequently.

We are facing an issue where we have synchronous proxy-sap po-rest api service.

The interface is working fine when response is returned by the REST API.

This is XML to JSON.

We need to send a custom response back to SAP with HTTP_STATUS and HTTP_STATUS_TEXT whenever the API is not responding/connection refused or any other fatal exception.

We are on Single Stack 7.5 SP09 patch 1.

We are have tried various options and referred to various blogs on REST API with no luck.

Notes:2273265,2378808,2339900,2032345

https://blogs.sap.com/2014/12/18/pi-rest-adapter-blog-overview/

https://blogs.sap.com/2015/04/10/pi-rest-adapter-custom-error-handling/

Attached is the config from RESt Receiver.

The error which we get when we define the custom error handling is

Error while receiving by HTTP (error code: Configuration error on Adapter-Framework(AFW)-Server, error text: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.NullPointerException: while trying to invoke the method java.lang.CharSequence.toString() of a null object loaded from local variable 'replacement') More details about AFW error can be found in XI monitor MessagingException

The error which we get when do not keep any custom error handling is :

Error while receiving by HTTP (error code: Configuration error on Adapter-Framework(AFW)-Server, error text: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: java.net.ConnectException: Connection refused: connect (local port xxxx2 to address 0:0:0:0:0:0:0:0, remote port 443 to address xxx.58.xxx.234 (xxxs01-in-xxx.1exx.net))) More details about AFW error can be found in XI monitor MessagingException

Looking forward for Issue resolution on this ,we are also thinking of raising this with SAP if its something reported with SAP PO 7.5 SP09 patch 1 with rest reciever adapter.

Thanks

Ahmed

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Oct 30, 2017 at 09:37 AM

    Hi Shaik,

    From your configuration I understood that you are sending messages from Proxy to Firebase cloud (REST service) using PI for Mass notification setup.

    1) The Error you are getting during custom error handling might be in different format which results in null pointer exception (Check once using REST Client)

    2) Error which you are getting without custom error handling is the real error, for this please check your connection (Firewall settings) between your corporate network(SAP PO environment) and Firebase cloud, try to do telnet from your PO System node to your Endpoint (Firebase cloud)

    Regards,

    Rajesh Kannan K

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 31, 2017 at 03:30 PM

    Hello Shaik,
    As it was said earlier by contributors, the error you have got in the second case is not an HTTP-service error but communication error on network level. Taking into account that you're trying to connect to port 443 (SSL connection ) and nature of the error: java.net.ConnectException: Connection refused, I suppose the root cause is SSL socket establishing. Check, whether local firewall/router allows SSL connection and forwards network traffic correctly, after that check that required certificates (if any) are stored in NWA Key Storage properly. As a reference, I'd recommend you to firstly try the REST call using SOAPUI or any alternative REST client tool. Simulate the call from the same host where PI system is installed to ensure no network problems and successful response from destination REST service.

    Wish you good luck with your integration.

    Best regards,
    Vadym

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 31, 2017 at 06:59 AM

    This error is not coming from rest. seems firewall issue

    Before you play with exception first play with status codes, try 500 and see if you are able trigger customer message. Do not use any http status fetch.just put some dummy message and experiment

    Add comment
    10|10000 characters needed characters exceeded