SAP Call a function Connector generates an IllegalStateException

Jerome.Jargot's picture
Jerome.Jargot
Blog Categories: 

Component: sap-jco3-callfunction | Version: 1.0.0
Component: Bonita | Version: All | Edition: Subscription

ConnectorException: Can't get a SAP Destination Provider

We are using the bonita Connector in order to Call a SAP function (BAPI, RFC or ZBAPI) using SAPjco3. There are several connectors used with different tasks, which are part of several processes.

sap_call_function_first_wizard_page.png

The involved connector was successfully tested in an environment with only one process installed.

Note that the error messages are generated only in the production environment where there are many other processes installed, with other SAP Call a function connectors.

2019-05-06 10:56:30.561 +0100 SEVERE: org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork THREAD_ID=109 | HOSTNAME=BONITA-PC | TENANT_ID=1 | The work [ExecuteConnectorOfActivity: flowNodeInstanceId = 40001, connectorDefinitionName = SAP JCO3 connector Message_Server] failed. The failure will be handled.
2019-05-06 10:56:30.575 +0100 SEVERE: org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork THREAD_ID=109 | HOSTNAME=BONITA-PC | TENANT_ID=1 | org.bonitasoft.engine.core.connector.exception.SConnectorException : "PROCESS_DEFINITION_ID=5124046011569727637 | PROCESS_NAME=SAP | PROCESS_VERSION=754 | PROCESS_INSTANCE_ID=1001 | ROOT_PROCESS_INSTANCE_ID=1001 | FLOW_NODE_DEFINITION_ID=6754310665198349125 | FLOW_NODE_INSTANCE_ID=40001 | FLOW_NODE_NAME=STEP SAP Message_Server | CONNECTOR_IMPLEMENTATION_CLASS_NAME=SAP JCO3 connector Message_Server | CONNECTOR_INSTANCE_ID=40001 | org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: Can't get a SAP Destination Provider"
org.bonitasoft.engine.core.connector.exception.SConnectorException: PROCESS_DEFINITION_ID=5124046011569727637 | PROCESS_NAME=SAP | PROCESS_VERSION=754 | PROCESS_INSTANCE_ID=1001 | ROOT_PROCESS_INSTANCE_ID=1001 | FLOW_NODE_DEFINITION_ID=6754310665198349125 | FLOW_NODE_INSTANCE_ID=40001 | FLOW_NODE_NAME=STEP SAP Message_Server | CONNECTOR_IMPLEMENTATION_CLASS_NAME=SAP JCO3 connector Message_Server | CONNECTOR_INSTANCE_ID=40001 | org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: Can't get a SAP Destination Provider
    at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:285)
    at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnector(ConnectorServiceImpl.java:158)
    at org.bonitasoft.engine.connector.ConnectorServiceDecorator.executeConnector(ConnectorServiceDecorator.java:114)
    at org.bonitasoft.engine.execution.work.ExecuteConnectorWork.work(ExecuteConnectorWork.java:138)
    at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
    at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
    at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
    at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
    at org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork.work(FailureHandlingBonitaWork.java:66)
    at org.bonitasoft.engine.work.BonitaWork.run(BonitaWork.java:56)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: Can't get a SAP Destination Provider
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:125)
    at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:279)
    ... 12 more
Caused by: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: Can't get a SAP Destination Provider
    at java.util.concurrent.FutureTask.report(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at com.bonitasoft.engine.connector.impl.ConnectorExecutorTimedOut.getValue(ConnectorExecutorTimedOut.java:54)
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:122)
    ... 13 more
Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: Can't get a SAP Destination Provider
    at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.connect(SConnectorAdapter.java:84)
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:205)
    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:176)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    ... 3 more
Caused by: org.bonitasoft.engine.connector.ConnectorException: Can't get a SAP Destination Provider
    at org.bonitasoft.connectors.sap.SAPCallFunction.connect(SAPCallFunction.java:363)
    at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.connect(SConnectorAdapter.java:82)
    ... 6 more
Caused by: java.lang.IllegalStateException: You can use only one SAP destination (and they should use the configuration). The current one is named applicationServer
    at com.bonitasoft.engine.connector.SAPMonoDestinationDataProvider.getInstance(SAPMonoDestinationDataProvider.java:54)
    at org.bonitasoft.connectors.sap.SAPCallFunction.connect(SAPCallFunction.java:361)
    ... 7 more

Answer

The various SAP Call a function connectors does not use the same value with the Destination name connector's input property while running.

I can see in the inline image that the involved connector is using bonitaApplicationServer as Destination name. I guess that a previous connector execution from another process already used applicationServer, which is a limitation.

This is the value found in the error message generated:

... IllegalStateException: You can use only one SAP destination ... The current one is named applicationServer

Resolution

A custom connector is needed in your situation.

Notifications