cancel
Showing results for 
Search instead for 
Did you mean: 

Sync/Async bridge via JMS with FAULT messages

0 Kudos

Hello all,<br><br>

I set up a sync/async bridge scenario with using of JMS communication channel (SAP - JMSReceiverCC - JMSServer and application - JMSSenderCC - SAP). The normal communication works fine.<br>

But what we can not solve is the Fault Message handling. If there is a application error behind the JMS, a fault message is generated instead of proper application response and sent back to XI. Without any additional setup of JMS Sender CC the processing of the message ends with "MAPPING - EXCEPTION_DURING_EXECUTE", because normal "response mapping" is executed instead of "fault message mapping". This is correct behavior without any discussion.<br><br>

[SAPhelp|http://help.sap.com/saphelp_nw70/helpdata/en/45/202845de34072ce10000000a155369/frameset.htm] says that there are 2 module parameters to be set : fault, faultNamespace. The description is rather vague, so let's see, what the "NotifyResponseBean" does, when parameters fault/faultNamespace are filled:<br><br>

<pre>if(fault != null && faultNamespace != null)

{

if(faultNamespace.equals("http://sap.com/xi/XI/System"))

{

((XIMessage)message1).setMessageClass(MessageClass.SYSTEM_ERROR);

((XIMessage)message1).setError(fault, "no additional information");

} else

{

((XIMessage)message1).setMessageClass(MessageClass.APPLICATION_ERROR);

ErrorInfo errorinfo = message1.createErrorInfo();

errorinfo.setAttribute("ApplicationFaultInterface", fault);

errorinfo.setAttribute("ApplicationFaultInterfaceNamespace", faultNamespace);

errorinfo.setAttribute("ErrorCode", fault);

errorinfo.setAttribute("AdditionalErrorText", "no additional information");

message1.setErrorInfo(errorinfo);

}

} else

{

((XIMessage)message1).setMessageClass(MessageClass.APPLICATION_RESPONSE);

}</pre><br>

The code is pretty straight forward so one could assume, that it's the name and namespace of inbound synchronnous message interface what is supposed to be filled in the values of each parameter. And from that kind of information SAP XI can evolve how to handle the response, actually the fault.<br>

Unfortunatelly the real situation is different - every time the fault message is generated and sent back to XI, the response is correctly corelated with the request message, "WaitResponseBean" and "NotifyResponseBean" are finished correctly and the processing crashes in messaging class on following exception:<br><br>

java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:592) at

com.sap.aii.messaging.mo.MessageContext.setAttribute(MessageContext.java:140) at

com.sap.aii.adapter.xi.ms.XIMessage.updateHeaders(XIMessage.java:4244) at

com.sap.aii.adapter.xi.ms.XIMessage.getTransportHeaders(XIMessage.java:570) at

com.sap.aii.af.ra.ms.impl.ServerConnectionImpl.request(ServerConnectionImpl.java:212) at

com.sap.aii.af.ra.ms.impl.core.transport.http.MessagingServlet.doPost(MessagingServlet.java:337) at ...

<br><br>

Is there anyone, who can put more light on JMS sync/async bridge fault handling ???

<br><br>

Thank you ...<br>

Regards

Tomas

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hello again,

I proceed in investigation little more, but the main problem has not been solved. I found that the problem is not even in WaitResponseBean (placed in JMCReceiverCC). This bean is woken up properly on base of proper CorrelationID. See the log:

2009-10-15 11:00:33 Success WRB: entering WaitResponseBean

2009-10-15 11:00:33 Success WRB: retrieving the message for f1ea1fc0-b96d-11de-9b68-00144f4acd86 ...

2009-10-15 11:00:46 Success WRB: retrieved the message: ApplicationError

2009-10-15 11:00:46 Success WRB: leaving WaitResponseBean

I think, that the problem is somewhere within main messaging functionality. I suppose that on base of exception message:

com.sap.aii.messaging.mo.MessageContext.setAttribute(MessageContext.java:140) at

which is generated.

Any ideas or comments ?

Thank you in advance.

Regards

Tomas