Greetings,
I’m following this Get started as a Java developer using Spring guide but I am having hard time to make it work because of Connection refused: getsockopt
error when trying to create a new process instance using:
zeebeClient.newCreateInstanceCommand()
.bpmnProcessId("process-payments")
.latestVersion()
.send()
.join();
Notice:
- Running Camunda 8 Run (Self-Managed) on Windows using the official guide.
- Successfully deployed process definitions and ran process instances using the desktop modeler.
- The spring boot demo is using version 3.5.0 with Java version 21.
I have:
- Tried the completed demo provided by the guide but it failed with the same error.
- Checked that he Zeebe Broker is accessible at
localhost:8080
, and the Zeebe Gateway is accessible atlocalhost:26500
:
PS C:\Windows\system32> Test-NetConnection -ComputerName localhost -Port 26500
ComputerName : localhost
RemoteAddress : ::1
RemotePort : 26500
InterfaceAlias : Loopback Pseudo-Interface 1
SourceAddress : ::1
TcpTestSucceeded : True
PS C:\Windows\system32> Test-NetConnection -ComputerName localhost -Port 8080
ComputerName : localhost
RemoteAddress : ::1
RemotePort : 8080
InterfaceAlias : Loopback Pseudo-Interface 1
SourceAddress : ::1
TcpTestSucceeded : True
Logs
:: Spring Boot :: (v3.5.0)
2025-06-16T11:31:12.415+03:00 INFO 21552 --- [ main] c.d.payment.PaymentProcessApplication : Starting PaymentProcessApplication using Java 24 with PID 21552 (D:\Desktop\payment\target\classes started by Ahmad Al-Deeb in D:\Desktop\payment)
2025-06-16T11:31:12.421+03:00 INFO 21552 --- [ main] c.d.payment.PaymentProcessApplication : No active profile set, falling back to 1 default profile: "default"
2025-06-16T11:31:15.049+03:00 INFO 21552 --- [ main] z.s.c.c.ZeebeClientProdAutoConfiguration : Creating ZeebeClient using ZeebeClientConfigurationImpl [ZeebeClientConfigurationImpl{camundaClientProperties=CamundaClientProperties{mode=selfManaged, tenantId='<default>', auth=AuthProperties{clientId='***', clientSecret='***', tokenUrl=http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token, credentialsCachePath='null', connectTimeout=null, readTimeout=null}, zeebe=ZeebeClientProperties{executionThreads=null, messageTimeToLive=null, maxMessageSize=null, maxMetadataSize=null, requestTimeout=null, caCertificatePath='null', keepAlive=null, overrideAuthority='null', defaults=ZeebeWorkerValue{type='null', name='null', timeout=null, maxJobsActive=null, requestTimeout=null, pollInterval=null, autoComplete=null, fetchVariables=null, enabled=null, methodInfo=null, tenantIds=null, forceFetchAllVariables=null, streamEnabled=null, streamTimeout=null, maxRetries=0}, override={}, preferRestOverGrpc=false, grpcAddress=http://127.0.0.1:26500, restAddress=https://jfk-1.zeebe.camunda.io/eae6d1c6-bcea-4821-9085-3b00cbc270c9} io.camunda.zeebe.spring.client.properties.common.ZeebeClientProperties@376e7531, cloud=CamundaClientCloudProperties{region='jfk-1', clusterId='eae6d1c6-bcea-4821-9085-3b00cbc270c9', baseUrl='null', port=null}}, jsonMapper=io.camunda.zeebe.client.impl.ZeebeObjectMapper@35fb22a9, interceptors=[], chainHandlers=[], zeebeClientExecutorService=io.camunda.zeebe.spring.client.jobhandling.ZeebeClientExecutorService@6c8909c3, credentialsProvider=io.camunda.zeebe.client.impl.oauth.OAuthCredentialsProvider@1e008f36}]
2025-06-16T11:31:17.201+03:00 INFO 21552 --- [ main] c.d.payment.PaymentProcessApplication : Started PaymentProcessApplication in 6.346 seconds (process running for 8.493)
2025-06-16T11:31:17.676+03:00 WARN 21552 --- [-worker-ELG-1-4] i.c.z.client.impl.ZeebeCallCredentials : The request's security level does not guarantee that the credentials will be confidential.
2025-06-16T11:31:17.739+03:00 INFO 21552 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2025-06-16T11:31:17.759+03:00 ERROR 21552 --- [ main] o.s.boot.SpringApplication : Application run failed
io.camunda.zeebe.client.api.command.ClientStatusException: null
at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.transformExecutionException(ZeebeClientFutureImpl.java:116) ~[zeebe-client-java-8.7.5.jar:8.7.5]
at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.join(ZeebeClientFutureImpl.java:54) ~[zeebe-client-java-8.7.5.jar:8.7.5]
at com.deeb.payment.PaymentProcessApplication.run(PaymentProcessApplication.java:31) ~[classes/:na]
at org.springframework.boot.SpringApplication.lambda$callRunner$5(SpringApplication.java:789) ~[spring-boot-3.5.0.jar:3.5.0]
at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:82) ~[spring-core-6.2.7.jar:6.2.7]
at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60) ~[spring-core-6.2.7.jar:6.2.7]
at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:86) ~[spring-core-6.2.7.jar:6.2.7]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:797) ~[spring-boot-3.5.0.jar:3.5.0]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:788) ~[spring-boot-3.5.0.jar:3.5.0]
at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:773) ~[spring-boot-3.5.0.jar:3.5.0]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186) ~[na:na]
at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:636) ~[na:na]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:773) ~[spring-boot-3.5.0.jar:3.5.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:325) ~[spring-boot-3.5.0.jar:3.5.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1362) ~[spring-boot-3.5.0.jar:3.5.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1351) ~[spring-boot-3.5.0.jar:3.5.0]
at com.deeb.payment.PaymentProcessApplication.main(PaymentProcessApplication.java:22) ~[classes/:na]
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: CANCELLED
at java.base/java.util.concurrent.CompletableFuture.wrapInExecutionException(CompletableFuture.java:347) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:442) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2119) ~[na:na]
at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.join(ZeebeClientFutureImpl.java:52) ~[zeebe-client-java-8.7.5.jar:8.7.5]
... 21 common frames omitted
Caused by: io.grpc.StatusRuntimeException: CANCELLED
at io.grpc.Status.asRuntimeException(Status.java:532) ~[grpc-api-1.68.3.jar:1.68.3]
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:481) ~[grpc-stub-1.68.3.jar:1.68.3]
at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:489) ~[grpc-core-1.68.3.jar:1.68.3]
at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:453) ~[grpc-core-1.68.3.jar:1.68.3]
at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:486) ~[grpc-core-1.68.3.jar:1.68.3]
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:564) ~[grpc-core-1.68.3.jar:1.68.3]
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:72) ~[grpc-core-1.68.3.jar:1.68.3]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:729) ~[grpc-core-1.68.3.jar:1.68.3]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:710) ~[grpc-core-1.68.3.jar:1.68.3]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.68.3.jar:1.68.3]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[grpc-core-1.68.3.jar:1.68.3]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1095) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:619) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:1447) ~[na:na]
Caused by: java.net.ConnectException: Connection refused: getsockopt
at java.base/sun.nio.ch.Net.pollConnect(Native Method) ~[na:na]
at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:628) ~[na:na]
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:533) ~[na:na]
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:583) ~[na:na]
at java.base/java.net.Socket.connect(Socket.java:665) ~[na:na]
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:161) ~[na:na]
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:516) ~[na:na]
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:604) ~[na:na]
at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:274) ~[na:na]
at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:380) ~[na:na]
at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:393) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1029) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:962) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:898) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:871) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1162) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1126) ~[na:na]
at io.camunda.zeebe.client.impl.oauth.OAuthCredentialsProvider.fetchCredentials(OAuthCredentialsProvider.java:150) ~[zeebe-client-java-8.7.5.jar:8.7.5]
at io.camunda.zeebe.client.impl.oauth.OAuthCredentialsCache.computeIfMissingOrInvalid(OAuthCredentialsCache.java:123) ~[zeebe-client-java-8.7.5.jar:8.7.5]
at io.camunda.zeebe.client.impl.oauth.OAuthCredentialsProvider.applyCredentials(OAuthCredentialsProvider.java:79) ~[zeebe-client-java-8.7.5.jar:8.7.5]
at io.camunda.zeebe.client.impl.ZeebeCallCredentials.lambda$applyRequestMetadata$0(ZeebeCallCredentials.java:49) ~[zeebe-client-java-8.7.5.jar:8.7.5]
... 3 common frames omitted