An error Invalid Session ID
is occuring on Mule an a application that use SOAP with SugarCRM Connector (http://mulesoft.github.io/sugarcrm-connector/).
But this error occur in this scenario:
- App starts and process all Poll (database query)
- SOAP works fine
- The App stays waiting a new update/insert
- After of a time (24 hours, p.e) a new update/insert occurs
- The flow is processed in the App
- But, the following error occurs (repreat for ever):
EDIT:
2016-03-24 12:31:30,470 [pool-106-thread-1] ERROR org.mule.retry.notifiers.ConnectNotifier - Failed to connect/reconnect: Work Descriptor. Root Exception was: Invalid Session ID. Type: class org.apache.cxf.binding.soap.SoapFault 2016-03-24 12:31:30,471 [pool-106-thread-1] ERROR org.mule.exception.DefaultMessagingExceptionStrategy - ******************************************************************************** Message : Failed to invoke getEntryList. Message payload is of type: GetEntryListRequest Code : MULE_ERROR-29999 -------------------------------------------------------------------------------- Exception stack is: 1. Invalid Session ID (org.apache.cxf.binding.soap.SoapFault) org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor:84 (null) 2. Invalid Session ID (javax.xml.ws.soap.SOAPFaultException) org.apache.cxf.jaxws.JaxWsClientProxy:158 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/xml/ws/soap/SOAPFaultException.html) 3. Failed to invoke getEntryList. Message payload is of type: GetEntryListRequest (org.mule.api.MessagingException)
org.mule.devkit.processor.DevkitBasedMessageProcessor:133 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html) -------------------------------------------------------------------------------- Root Exception stack trace: org.apache.cxf.binding.soap.SoapFault: Invalid Session ID at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:84) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:51) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:40) + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)2016-03-24 12:31:40,471 [pool-106-thread-1] ERROR org.mule.retry.notifiers.ConnectNotifier - Failed to connect/reconnect: Work Descriptor. Root Exception was: Invalid Session ID. Type: class org.apache.cxf.binding.soap.SoapFault 2016-03-24 12:31:40,472 [pool-106-thread-1] ERROR org.mule.exception.DefaultMessagingExceptionStrategy - ******************************************************************************** Message : Failed to invoke getEntryList. Message payload is of type: GetEntryListRequest Code : MULE_ERROR-29999 -------------------------------------------------------------------------------- Exception stack is: 1. Invalid Session ID (org.apache.cxf.binding.soap.SoapFault) org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor:84 (null) 2. Invalid Session ID (javax.xml.ws.soap.SOAPFaultException) org.apache.cxf.jaxws.JaxWsClientProxy:158 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/xml/ws/soap/SOAPFaultException.html) 3. Failed to invoke getEntryList. Message payload is of type: GetEntryListRequest (org.mule.api.MessagingException)
org.mule.devkit.processor.DevkitBasedMessageProcessor:133 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html) -------------------------------------------------------------------------------- Root Exception stack trace: org.apache.cxf.binding.soap.SoapFault: Invalid Session ID at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:84) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:51) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:40) + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
I configured reconnection accord the image below, but does not error continues.
EDIT:
XML Configuration (simplified)
<db:oracle-config name="Oracle_Configuration" host="${db.host}" port="${db.port}" instance="${db.instance}" user="${db.user}" password="${db.password}" doc:name="Oracle Configuration">
<db:pooling-profile/>
</db:oracle-config>
<sugar:config name="Sugar__Configuration" username="${crm.ws.user}" password="${crm.ws.password}" endpoint="${crm.ws.endpoint}" doc:name="Sugar: Configuration">
<sugar:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
<reconnect-forever frequency="60000"/>
</sugar:config>
<flow name="produto-precoFlow" processingStrategy="synchronous">
<poll doc:name="Poll" doc:description="Produto">
<fixed-frequency-scheduler frequency="10000"/>
<watermark variable="carimboTempo" default-expression="2016-02-24 00:00:00" selector="MAX" selector-expression="#[message.payload.datalt]"/>
<db:select config-ref="Oracle_Configuration" doc:name="Database">
<db:parameterized-query><![CDATA[SELECT * FROM PRODUTO WHERE TO_CHAR(DATALT, 'yyyy-mm-dd hh24:mi:ss') > #[flowVars.carimboTempo]]]></db:parameterized-query>
</db:select>
</poll>
<foreach doc:name="For Each">
<enricher target="#[payload.produtoPrecoSugar]" doc:name="Message Enricher Produto">
<flow-ref name="produto-precoSub_FlowProduto" doc:name="produto-precoSub_FlowProduto"/>
</enricher>
// [...] mode code here (original)
<scripting:component doc:name="Groovy Inserir/Alterar">
<scripting:script engine="Groovy"><![CDATA[import org.mule.modules.sugarcrm.request.SetEntryRequest;
import com.sugarcrm.sugarcrm.NameValue;
req = new SetEntryRequest();
req.setModuleName("AOS_Products");
nameValues = [];
for ( e in message.payload ) {
nameValue = new NameValue();
nameValue.setName(e.key);
nameValue.setValue(e.value.toString());
nameValues.add(nameValue);
}
req.setNameValueList(nameValues);
return req;]]></scripting:script>
</scripting:component>
<sugar:set-entry config-ref="Sugar__Configuration" doc:name="Sugar Inserir/Alterar"/>
</foreach>
</flow>
<sub-flow name="produto-precoSub_FlowProduto">
<scripting:component doc:name="Groovy Id Produto">
<scripting:script engine="Groovy"><![CDATA[import org.mule.modules.sugarcrm.request.GetEntryListRequest;
req = new GetEntryListRequest();
req.setModuleName("AOS_Products");
whereQuery = "aos_products.deleted = 0";
for ( e in message.payload ) {
if (e.key == "sapiens_codtpr_c" || e.key == "sapiens_datini_c" || e.key == "sapiens_codser_c") {
whereQuery = whereQuery + " and " + e.key + " = '" + e.value.toString() + "'";
} else if (e.key == "sapiens_codemp_c" || e.key == "sapiens_qtdmax_c") {
whereQuery = whereQuery + " and " + e.key + " = " + e.value.toString();
}
}
req.setQuery(whereQuery);
req.setSelectFields(["id"]);
req.setDeleted(0);
return req;
]]></scripting:script>
</scripting:component>
<sugar:get-entry-list config-ref="Sugar__Configuration" doc:name="Sugar Id Produto e Preço"/>
</sub-flow>
What could be ocurring? Is there a form to resolve this problem?