Exception while closing command context: no processes deployed with key 'New_Workflow'

Hi, I have recently changed the process of deploying camunda in my project, previously I was packaging it as a war file and deploying in wildfly and now I am using springboot integrated tomcat to run it, but now when I am trying to trigger a particular workflow , I am getting the following error:

org.camunda.bpm.engine.exception.NullValueException: no processes deployed with key ‘New_Workflow’: processDefinition is null

Even though the id is correctly mentioned and I have checked for the same in the BPMN model and its xml file also.

Spring-Boot: (v3.1.5)
Camunda Platform: (v7.20.0)
Camunda Platform Spring Boot Starter: (v7.20.0)

What could be the solution for this?

Thanks!

Did you check whether the process has been actually deployed?

To auto-deploy processes, you need to add a file processes.xml to the resources/META-INF directory. This file can be empty. You can read more in the documentation:

Hi, yes I have the processes.xml file there already, and this is how I am triggering the flow from controller class:

@PostMapping("/NewWorkflow")
public String home1() {
	runtimeService.startProcessInstanceByKey("New_Workflow");
	return "Welcome!! ";

Thanks!

Hi @ThomasShelby,

the auto deployment Stephan mentioned requires the @EnableProcessApplication annotation.

It prints information about the deployment on INFO level to the console.

Hope this helps, Ingo

1 Like

Hi @Ingo_Richtsmeier ,

I have added the @EnableProcessApplication annotation to the main class and after that I have the following logs:

INFO 16852 — [ main] c.t.c.w.c.springboot.WebApplication : Starting WebApplication using Java 17.0.8 with PID 16852
INFO 16852 — [ main] c.t.c.w.c.springboot.WebApplication : No active profile set, falling back to 1 default profile: “default”
INFO 16852 — [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
INFO 16852 — [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JDBC repositories in DEFAULT mode.
INFO 16852 — [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 23 ms. Found 0 JDBC repository interfaces.
INFO 16852 — [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
INFO 16852 — [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
INFO 16852 — [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 2 ms. Found 0 JPA repository interfaces.
INFO 16852 — [ main] trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.ws.config.annotation.DelegatingWsConfiguration’ of type [org.springframework.ws.config.annotation.DelegatingWsConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 16852 — [ main] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
INFO 16852 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
INFO 16852 — [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
INFO 16852 — [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.15]
INFO 16852 — [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
INFO 16852 — [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4184 ms
INFO 16852 — [ main] .c.b.s.b.s.r.CamundaJerseyResourceConfig : Configuring camunda rest api.
INFO 16852 — [ main] .c.b.s.b.s.r.CamundaJerseyResourceConfig : Finished configuring camunda rest api.
INFO 16852 — [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
INFO 16852 — [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.2.7.Final
INFO 16852 — [ main] org.hibernate.cfg.Environment : HHH000406: Using bytecode reflection optimizer
INFO 16852 — [ main] o.h.b.i.BytecodeProviderInitiator : HHH000021: Bytecode provider name : bytebuddy
INFO 16852 — [ main] o.s.o.j.p.SpringPersistenceUnitInfo : No LoadTimeWeaver setup: ignoring JPA class transformer
INFO 16852 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting…
INFO 16852 — [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@3e01796a
INFO 16852 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
INFO 16852 — [ main] o.h.b.i.BytecodeProviderInitiator : HHH000021: Bytecode provider name : bytebuddy
INFO 16852 — [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
INFO 16852 — [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit ‘default’
INFO 16852 — [ main] org.camunda.bpm.spring.boot : STARTER-SB040 Setting up jobExecutor with corePoolSize=3, maxPoolSize:10
INFO 16852 — [ main] org.camunda.bpm.engine.cfg : ENGINE-12003 Plugin ‘CompositeProcessEnginePlugin[genericPropertiesConfiguration, camundaProcessEngineConfiguration, camundaDatasourceConfiguration, camundaJobConfiguration, camundaHistoryConfiguration, camundaMetricsConfiguration, camundaAuthorizationConfiguration, failedJobConfiguration, disableDeploymentResourcePattern, eventPublisherPlugin, ApplicationContextClassloaderSwitchPlugin, ConnectProcessEnginePlugin, SpringBootSpinProcessEnginePlugin]’ activated on process engine ‘default’
INFO 16852 — [ main] org.camunda.bpm.spring.boot : STARTER-SB020 ProcessApplication enabled: autoDeployment via springConfiguration#deploymentResourcePattern is disabled
INFO 16852 — [ main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-001: Initialized Camunda Spring Boot Eventing Engine Plugin.
INFO 16852 — [ main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-003: Task events will be published as Spring Events.
INFO 16852 — [ main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-005: Execution events will be published as Spring Events.
INFO 16852 — [ main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-009: Listeners will not be invoked if a skipCustomListeners API parameter is set to true by user.
INFO 16852 — [ main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-007: History events will be published as Spring events.
Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts
INFO 16852 — [ main] org.camunda.bpm.connect : CNCT-01004 Discovered provider for connector id ‘http-connector’ and class ‘org.camunda.connect.httpclient.impl.HttpConnectorImpl’: ‘org.camunda.connect.httpclient.impl.HttpConnectorProviderImpl’
INFO 16852 — [ main] org.camunda.bpm.connect : CNCT-01004 Discovered provider for connector id ‘soap-http-connector’ and class ‘org.camunda.connect.httpclient.soap.impl.SoapHttpConnectorImpl’: ‘org.camunda.connect.httpclient.soap.impl.SoapHttpConnectorProviderImpl’
INFO 16852 — [ main] org.camunda.spin : SPIN-01010 Discovered Spin data format provider: org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormatProvider[name = application/json]
INFO 16852 — [ main] org.camunda.spin : SPIN-01010 Discovered Spin data format provider: org.camunda.spin.impl.xml.dom.format.DomXmlDataFormatProvider[name = application/xml]
INFO 16852 — [ main] org.camunda.spin : SPIN-01009 Discovered Spin data format: org.camunda.spin.impl.xml.dom.format.DomXmlDataFormat[name = application/xml]
INFO 16852 — [ main] org.camunda.spin : SPIN-01009 Discovered Spin data format: org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormat[name = application/json]
INFO 16852 — [ main] org.camunda.bpm.dmn.feel.scala : FEEL/SCALA-01001 Spin value mapper detected
INFO 16852 — [ main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@123426a9, org.camunda.spin.plugin.impl.feel.integration.SpinValueMapper@4353db40)), function-provider: org.camunda.bpm.dmn.feel.impl.scala.function.CustomFunctionTransformer@5114c8a1, clock: SystemClock, configuration: Configuration(false)]
INFO 16852 — [ main] org.camunda.bpm.engine : ENGINE-00001 Process Engine default created.
WARN 16852 — [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
INFO 16852 — [ main] o.c.b.s.b.s.w.f.LazyInitRegistration : lazy initialized org.camunda.bpm.spring.boot.starter.webapp.filter.LazyProcessEnginesFilter@50b734c4
INFO 16852 — [ main] o.c.b.s.b.s.w.f.LazyInitRegistration : lazy initialized org.camunda.bpm.spring.boot.starter.webapp.filter.LazySecurityFilter@1a7cb3a4
INFO 16852 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8025 (http) with context path ‘’
INFO 16852 — [ main] org.camunda.bpm.container : ENGINE-08026 No processes.xml file found in process application ‘webApplication’
INFO 16852 — [ main] org.camunda.bpm.container : ENGINE-08050 Process application webApplication successfully deployed
INFO 16852 — [ main] c.t.c.w.c.springboot.WebApplication : Started WebApplication in 12.427 seconds (process running for 14.306)
INFO 16852 — [ main] org.camunda.bpm.engine.jobexecutor : ENGINE-14014 Starting up the JobExecutor[org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor].
INFO 16852 — [ingJobExecutor]] org.camunda.bpm.engine.jobexecutor : ENGINE-14018 JobExecutor[org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor] starting to acquire jobs
INFO 16852 — [nio-8025-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet ‘dispatcherServlet’
INFO 16852 — [nio-8025-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet ‘dispatcherServlet’
INFO 16852 — [nio-8025-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
ERROR 16852 — [nio-8025-exec-1] org.camunda.bpm.engine.context : ENGINE-16004 Exception while closing command context: no processes deployed with key ‘New_Workflow’: processDefinition is null

org.camunda.bpm.engine.exception.NullValueException: no processes deployed with key ‘New_Workflow’: processDefinition is null

Here I can see this line: INFO 16852 — [ main] org.camunda.bpm.container : ENGINE-08026 No processes.xml file found in process application ‘webApplication’

Even though I have the file added at the location as mentioned earlier by Stephan.

Thanks!

Hi @ThomasShelby,

my output, generated from the camunda-archetype-spring-boot looks different.

But this looks suspicious:

Usually you add an empty processes.xml in the META-INF folder, especially when you use the @EnableProcessApplication configuration.

Hope this helps, Ingo

Hi @Ingo_Richtsmeier , I tried with empty processes.xml file and adding the annotation, but still getting the same issue, is there anything else that can be tried?

Hi @ThomasShelby,

as you are trying to convert an existing project to Spring Boot, there may be some leftovers.

You can create a new project for the spring boot starter from this archetype (It’s available on maven central in my Eclipse) and give it a try.

Then compare the projects piece by piece. There should be a slight difference that’s hard to spot without direct access to the code base.

Hope this helps, Ingo

Oh ok, will try this, thanks!