Hi there,
I created my very first and useful connector that does a string concatenation, following the great connector sdk documentation
Here you are my connector: concatenationConnector
I’m using a Pre-packaged runtime environment, I run the runtime embedding the connector as explained in the doc in this way:
java -cp 'connector-runtime-job-worker-with-depdencies.jar;concatenation-connector-with-dependencies.jar' \
io.camunda.connector.runtime.jobworker.Main
The connector is registered correctly:
Oct 18, 2022 1:27:08 PM io.camunda.connector.runtime.jobworker.Main lambda$main$0
INFO: Registering outbound connector OutboundConnectorRegistration { name=concatenation-connector, type=io.camunda:concatenation-api:1, function=io.camunda.connector.ConcatenationConnectorFunction, inputVariables=[input1, input2] }
But as soon as I start a process instance providing proper inputs, and the connector is invoked, I get the following error:
Oct 18, 2022 2:53:21 PM io.camunda.connector.runtime.util.outbound.ConnectorJobHandler handle
INFO: Received job 4503599628339500
Oct 18, 2022 2:53:21 PM io.camunda.connector.runtime.util.outbound.ConnectorJobHandler handle
SEVERE: Failed to process job 4503599628339500
java.util.NoSuchElementException
at java.base/java.util.ServiceLoader$2.next(ServiceLoader.java:1318)
at java.base/java.util.ServiceLoader$2.next(ServiceLoader.java:1306)
at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
at io.camunda.connector.runtime.util.outbound.ConnectorJobHandler.getSecretProvider(ConnectorJobHandler.java:77)
at io.camunda.connector.runtime.util.outbound.ConnectorJobHandler.handle(ConnectorJobHandler.java:54)
at io.camunda.zeebe.client.impl.worker.JobRunnableFactory.executeJob(JobRunnableFactory.java:44)
at io.camunda.zeebe.client.impl.worker.JobRunnableFactory.lambda$create$0(JobRunnableFactory.java:39)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Oct 18, 2022 2:53:21 PM io.camunda.zeebe.client.impl.worker.JobRunnableFactory executeJob
WARNING: Worker concatenation-connector failed to handle job with key 4503599628339500 of type io.camunda:concatenation-api:1, sending fail command to broker
java.lang.NullPointerException
at io.camunda.zeebe.gateway.protocol.GatewayOuterClass$FailJobRequest$Builder.setErrorMessage(GatewayOuterClass.java:22512)
at io.camunda.zeebe.client.impl.command.FailJobCommandImpl.errorMessage(FailJobCommandImpl.java:67)
at io.camunda.connector.runtime.util.outbound.ConnectorJobHandler.handle(ConnectorJobHandler.java:68)
at io.camunda.zeebe.client.impl.worker.JobRunnableFactory.executeJob(JobRunnableFactory.java:44)
at io.camunda.zeebe.client.impl.worker.JobRunnableFactory.lambda$create$0(JobRunnableFactory.java:39)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
What am I doing wrong here?
Thanks!
Enrico