Receive a NullPointerException at runtime when using the contact parameter on SOAP BT Reference.

Receive a NullPointerException at runtime when using the contact parameter on SOAP BT Reference.

book

Article ID: KB0071253

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix Service Grid 3.3.0

Description

When using a context parameter as a SOAP header on the SOAP Reference BT, we don’t see any error at Design time but once the application is deployed to AMX Admin, it throws the NPE for the SOAP Reference BT:

<<<<<<<<<<<< 
14 Feb 2017 15:07:29,883 [ComponentFrameworkTask] [ERROR] [Logistics] com.tibco.amx.cf.logger.lifecycle - "TIBCO-AMX-CF-000104: Error executing START_CONFIGURED_COMPONENT on Promoted Reference Binding. ApplicationName=Logistics PromotedReferenceName=OperationSoapFleetNonProd BindingName=SOAPReference_Binding1 ComponentURI=urn:amx:DevEnvironment/Logistics#reference-binding(OperationSoapFleetNonProd1/SOAPReference_Binding1)___1.0.0.v2017-02-14-1452 caused by: java.lang.NullPointerException" (ActionID="[root:Application-Deploy with Start:67]")
java.lang.NullPointerException
              at com.tibco.amf.binding.soap.runtime.context.ContextCache.addContextVariableMapping(ContextCache.java:67)
                at com.tibco.amf.binding.soap.runtime.context.ContextCache.prepareContextCache(ContextCache.java:61)
>>>>>>>>>>>> 
 

Issue/Introduction

Receive a NullPointerException at runtime when using the contact parameter on SOAP BT Reference.

Environment

All Supported Environments

Resolution

The operation binding has the same message/part in both input/output headers. This makes the context parameter have both Input and Output directions on the same promoted references. The direction conflict causes the direction to become null for this context parameter at runtime and a NPE is thrown when accessing the null direction.
 
Removing the duplicate header and only keeping it on the Input path or Output path from WSDLs, and updating the context parameters accordingly on the promoted references of the Logistics composite and in target interfaces, the application is able to start.