[Camunda 8 + SpringBoot] Error when Run App Server

Hi Guys,

I’m newbie for Camunda 8 intergrated with SpringBoot. I created project using:

  • Camunda Cloud and API Client and expose config file .yml
  • Configuration .yml in SpringBoot
  • Define a file .bpm and put into resource

This is some config my project

@SpringBootApplication
@EnableZeebeClient
@EnableProcessApplication
@ConditionalOnProperty(name = "camunda.bpm.enabled", havingValue = "true", matchIfMissing = true)
@ZeebeDeployment(classPathResources = {"send-email.bpmn","customer-onboarding.bpmn"})
public class CamundaApplication {
    public static void main(String[] args) {
        SpringApplication.run(CamundaApplication.class, args);
    }
}

camunda:
  bpm:
    admin-user:
      id: demo
      password: demo
zeebe:
  client:
    cloud:
      region: dsm-1
      clusterId: fd15ac6d-9bae-490a-8f5a-d94165bb8a38
      clientId: ipRK5OT~en9zor7TvSGIyt9qP2KITFQm
      clientSecret:  6TbVJ9A1fwlGdcU8nXToKZYxJy~l~_rV6.S1gI2CqoG0FT8-Dy8rc8fkby7gFVYU

Problem: When I run appserver and check in Camunda Cloud at Camunda Operate BUT no process which deployed
And in console has error:

org.springframework.context.ApplicationContextException: Failed to start bean 'zeebeClientLifecycle'; nested exception is io.camunda.zeebe.client.api.command.ClientStatusException: io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.22.jar:5.3.22]
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.22.jar:5.3.22]
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.22.jar:5.3.22]
	at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.22.jar:5.3.22]
	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.22.jar:5.3.22]
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) ~[spring-context-5.3.22.jar:5.3.22]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.22.jar:5.3.22]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.3.jar:2.7.3]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-2.7.3.jar:2.7.3]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.3.jar:2.7.3]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-2.7.3.jar:2.7.3]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.7.3.jar:2.7.3]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-2.7.3.jar:2.7.3]
	at com.cmcglobal.CamundaApplication.main(CamundaApplication.java:18) ~[classes/:na]
Caused by: io.camunda.zeebe.client.api.command.ClientStatusException: io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]

Could anyone help me?
Many Thanks.

Hi @ducterry,

First, I see that you mix Camunda 8 and Camunda 7. The camunda.bpm.admin-user configuration is part of Camunda 7 as is the @EnableProcessApplication annotation.
Second, be careful that you do not share the client configuration online. This configuration enables everyone to access your cluster. You can delete the client and create a new one to void the current configuration.

Now, have you tried to deploy the model directly?
Can you provide the model? Or the full stack trace?

1 Like

Thank Bro @StephanHaarmann

May be I created Project on start.camunda.com

After read to advise from you.

  • I remove Camunda7 in pom.xml But when I run still error. So, I still keep @EnableProcessApplication
  • I also create new ZeebeClient and Custom by Java Code as below
@Bean
    public static ZeebeClient getZeebeClient() {
        var credentialsProvider =
                new OAuthCredentialsProviderBuilder()
                        .authorizationServerUrl(ZEEBE_AUTHORIZATION_SERVER_URL)
                        .clientId(CAMUNDA_CLIENT_ID)
                        .clientSecret(CAMUNDA_CLIENT_SECRET)
                        .audience(ZEEBE_TOKEN_AUDIENCE)
                        .credentialsCachePath(ZEEBE_ADDRESS)
                        .build();

        return ZeebeClient.newCloudClientBuilder()
                .withClusterId(CAMUNDA_CLUSTER_ID)
                .withClientId(CAMUNDA_CLIENT_ID)
                .withClientSecret(CAMUNDA_CLIENT_SECRET)
                .withRegion(CAMUNDA_CLUSTER_REGION)
                .credentialsProvider(credentialsProvider)
                .usePlaintext()
                .build();
    }
  • Finally, I expose API to deploy this process.
@GetMapping("/instance")
    public ResponseEntity<?> deployInstance() {
        DeploymentEvent event = zeebeClient.newDeployResourceCommand()
                .addResourceFromClasspath("send-email.bpmn")
                .send()
                .join();


        LOG.info(
                "Deploy Process Key='{}', Decisions='{}', Processes='{}' , DecisionRequirements='{}'",
                event.getKey(), event.getDecisions(), event.getProcesses(),
                event.getDecisionRequirements());
        return new ResponseEntity<>("Deploy Sucessfully", HttpStatus.OK);
    }```

BUT have error:

io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason
at io.grpc.Status.asRuntimeException(Status.java:535) ~[grpc-api-1.49.1.jar:1.49.1]
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:487) ~[grpc-stub-1.49.1.jar:1.49.1]
at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:470) ~[grpc-core-1.49.1.jar:1.49.1]
at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:434) ~[grpc-core-1.49.1.jar:1.49.1]
at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:467) ~[grpc-core-1.49.1.jar:1.49.1]
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:563) ~[grpc-core-1.49.1.jar:1.49.1]
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70) ~[grpc-core-1.49.1.jar:1.49.1]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:744) ~[grpc-core-1.49.1.jar:1.49.1]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:723) ~[grpc-core-1.49.1.jar:1.49.1]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.49.1.jar:1.49.1]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[grpc-core-1.49.1.jar:1.49.1]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

I understand that you use spring-zeebe. If this is the case, there is no need to create a Zeebe client manually. Spring-Zeebe will create one with the configuration inside your application.yaml you can access this client via dependency injection, i.e., using @Autowired.
It’s odd, that there is still some dependency to Camunda 7 left. I would try to remove it. Although, this is probably not the root cause of your problem.

Please try to deploy the models directly from the modeler:


This will help us to narrow down the problem.

1 Like

Thank Bro @StephanHaarmann
Yes, indeed!
If deploy by tools as Camunda Modeler or on Modeler Cloud Camunda I worked.

@StephanHaarmann I also remove custom config ZeebeClient and seen console print as below

2023-02-02 14:10:23.049  INFO 9304 --- [           main] i.c.z.s.c.ZeebeClientSpringConfiguration : Creating ZeebeClient using ZeebeClientBuilder [gatewayAddress: 0.0.0.0:26500
jobWorkerMaxJobsActive: 32
numJobWorkerExecutionThreads: 1
defaultJobWorkerName: null
defaultJobTimeout: PT5M
defaultJobPollInterval: PT0.1S
defaultMessageTimeToLive: PT1H
defaultRequestTimeout: PT10S
overrideAuthority: null
]

Before I also build environment in Standalone using docker-compose I also config gateway to: 0.0.0.0: 26500 BUT for Cloud Camunda, it is not easy.

Could you give me some advise to learn Camunda integrated with SpringBoot?
I work as Backend Developer and using SpringBoot. This is first I research for Camunda

I will try read more documentation from Camunda website and try implement it and then reply topic to talk about Camunda.

Thanks for the additional information.
We know that the models are not the problem and that the client starts successfully. That is good.
I always felt that setting the client up with Camunda 8 SaaS is way easier than the self-managed setup :sweat_smile:, but the experience can differ from person to person. When you set up Camunda locally, there is usually no authentication enabled. What you can check:

  1. Does you client have access to the Zeebe API?
  2. Are there no typos in the configuration?
  3. Do the versions of client and cluster match?

The github repository of spring-zeebe includes examples, which can guide you in your setup:

1 Like

Bro @StephanHaarmann

I have just found this repository of Bro @BerndRuecker at YouTube Channel. It is helpful and same scope that I research for Camunda8.

I checked out at master branch and change configuraton into my camunda cluster and follow step-by-step by readme.md but deploy has error

Could not transfer metadata io.grpc:grpc-api/maven-metadata.xml from/to connectors-snapshots (https://artifacts.camunda.com/artifactory/connectors-snapshots/): transfer failed for https://artifacts.camunda.com/artifactory/connectors-snapshots/io/grpc/grpc-api/maven-metadata.xml
Could not transfer metadata io.grpc:grpc-api/maven-metadata.xml from/to zeebe (https://artifacts.camunda.com/artifactory/zeebe-io/): transfer failed for https://artifacts.camunda.com/artifactory/zeebe-io/io/grpc/grpc-api/maven-metadata.xml

io.grpc:grpc-api/maven-metadata.xmlfailed to transfer from https://artifacts.camunda.com/artifactory/connectors-snapshots/ during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of connectors-snapshots has elapsed or updates are forced. Original error: Could not transfer metadata io.grpc:grpc-api/maven-metadata.xml from/to connectors-snapshots (https://artifacts.camunda.com/artifactory/connectors-snapshots/): transfer failed for https://artifacts.camunda.com/artifactory/connectors-snapshots/io/grpc/grpc-api/maven-metadata.xml
io.grpc:grpc-api/maven-metadata.xmlfailed to transfer from https://artifacts.camunda.com/artifactory/zeebe-io/ during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of zeebe has elapsed or updates are forced. Original error: Could not transfer metadata io.grpc:grpc-api/maven-metadata.xml from/to zeebe (https://artifacts.camunda.com/artifactory/zeebe-io/): transfer failed for https://artifacts.camunda.com/artifactory/zeebe-io/io/grpc/grpc-api/maven-metadata.xml

This is issue for grpc or not. I’m not sure :smiley:

This is youtube Channel: Youtube Channel

This is Repository: Repository

1 Like

No, this looks like a problem with the maven setup. It currently relies on Camundas artifactory. Are you behind some firewall, which may block access to the maven repository?

Hi Bro @StephanHaarmann

Yes, I’m at company, may be policy security blocked access.
I will run again when come back home and inform to you.

You can check whether you can open https://artifacts.camunda.com/artifactory/connectors-snapshots/ in your browser.

1 Like

Dear Bro @StephanHaarmann

When I Run App Server at my home. It didn’t happen error of network. And then, I Call API which to deploy File *.bpm to Camunda Cluster but has error as under:

io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 485454502f
	at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:109) ~[netty-codec-http2-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:353) ~[netty-codec-http2-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:247) ~[netty-codec-http2-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:453) ~[netty-codec-http2-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:510) ~[netty-codec-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:449) ~[netty-codec-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279) ~[netty-codec-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.79.Final.jar:4.1.79.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.79.Final.jar:4.1.79.Final]
	at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

@Update: I fixed this error. In ZeebeConfig Client i remove usePlainText as below

@Bean
    public static ZeebeClient getZeebeClient() {
                var credentialsProvider =
                new OAuthCredentialsProviderBuilder()
                        .authorizationServerUrl(ZEEBE_AUTHORIZATION_SERVER_URL)
                        .clientId(ZEEBE_CLIENT_ID)
                        .clientSecret(ZEEBE_CLIENT_SECRET)
                        .audience(ZEEBE_TOKEN_AUDIENCE)
                        .build();

        ZeebeClient zeebeClient = ZeebeClient.newCloudClientBuilder()
                .withClusterId(CAMUNDA_CLUSTER_ID)
                .withClientId(ZEEBE_CLIENT_ID)
                .withClientSecret(ZEEBE_CLIENT_SECRET)
                .withRegion(CAMUNDA_CLUSTER_REGION)
                .gatewayAddress(ZEEBE_ADDRESS)
                .credentialsProvider(credentialsProvider)
                .build();
        return zeebeClient;
1 Like