Camunda Connector: Engine did not find my connector (id)

1,936 views
Skip to first unread message

christoph...@gmail.com

unread,
Jan 17, 2015, 9:32:46 AM1/17/15
to camunda-...@googlegroups.com
Hi,

I just started to play around with the camunda engine and possibility to develop my own connector. I started to use the file connector that Bernd Rücker has shown in the webinar last week.

--> https://github.com/camunda/camunda-consulting/tree/master/one-time-examples/2015-01-webinars

I used a Tomcat with camunda 7.2 from your side. So I think the configuration for connectors should be enabled. Right?

I rewrite the connector to make it much less complex (*g*) so that it just make an sys.out at the moment.

I made a short bpmn.20 process with a start, the connector call by service task, a human task (just to let the process not get finished.) and an end task.

The process gets deployed so that I can start it from the tasklist.

But then I get an error that the connector with the id was not found.

Tasklist shows:

The process could not be started. : cannot POST /camunda/api/engine/engine/default/process-definition/e89b87dd-9e40-11e4-b15b-d4bed966892b/submit-form (500)

The Tomcat log shows:

SEVERE: Error while closing command context
org.camunda.connect.ConnectorException: No connector found for connector id 'nameOfMyConnector'
at org.camunda.connect.plugin.impl.ServiceTaskConnectorActivityBehavior.ensureConnectorInitialized(ServiceTaskConnectorActivityBehavior.java:93)
at org.camunda.connect.plugin.impl.ServiceTaskConnectorActivityBehavior.execute(ServiceTaskConnectorActivityBehavior.java:48)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:42)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:27)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:129)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:450)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:440)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:420)
...



So it looks if the engine did not find my connector.

1. I placed the connector code as .jar in the lib of my demo process .war
2. The name of the connector is the name I placed in the ID attribute of my XYZConnector.java class

--> public static final String ID = "nameOfMyConnector";

Is that right? Or do I have to define the name somewhere else?

3. the org.camunda.connect.spi.ConnectorProvider File under META-INF/services show the path to the XYZConnectorProvicerImpl so that the engine should find the connector. Right?

Can somebody please check if the things I described were correct? If yes - what else may I did wrong that my connector is not found by the engine?






Sebastian Menski

unread,
Jan 17, 2015, 10:48:25 PM1/17/15
to camunda-...@googlegroups.com, christoph...@gmail.com
Hi Christoph,

I think the problem is that your connector is part of your war file. Currently the connector plugin only detects connectors during the start of the
engine. And if a connector is found it is logged by the engine. So if you added the HTTP or SOAP Connector you should find entries for
them in your log. I think you have to options: either put the connector.jar inside the lib folder of the tomcat or add you connector manually
at the start of your process application with:

Connectors.registerConnector(Connector<?> connector)

see [1].

Regarding the ID you are correct. The connector is registered by the ID returned by the connector provided which is normally defined
as constant of the connector interface.

I hope this solves your problem otherwise please ask again.

Cheers,
Sebastian

christoph...@gmail.com

unread,
Jan 18, 2015, 6:19:51 AM1/18/15
to camunda-...@googlegroups.com, christoph...@gmail.com
Thanks a lot Sebastian for your very quick response.

You solved my problem! I copied the connector to my tomcat lib and everything works fine from then on.


Maybe it would be helpful to add your advice with the two possibilities how to deploy a connector for the engine in the connector user guide.

http://docs.camunda.org/latest/guides/user-guide/#process-engine-connectors

Thank Christoph



thorben....@camunda.com

unread,
Jan 19, 2015, 4:36:57 AM1/19/15
to camunda-...@googlegroups.com, christoph...@gmail.com
Hi Christoph,

[1] documents how to extend connect. Note that with solution two, you have to make sure to unregister the connector before undeployment of the war or else you get a memory leak.

Cheers,
Thorben

[1] http://docs.camunda.org/latest/api-references/connect/#extending-connect-custom-connector
Reply all
Reply to author
Forward
0 new messages