Devtools reload not working


Hi friends,

I want to use Spring Boot Devtools to reload Camunda application during development. Unfortunately, that doesn’t work. During a reload my application fails with the following exception:

2017-09-22 18:30:34.585 ERROR 76464 --- [ost-startStop-1] o.a.c.c.C.[.[localhost].[/camunda]       : Exception starting filter [Engines Filter]

java.lang.IllegalStateException: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@107718a9 has been closed already
	at org.camunda.bpm.spring.boot.starter.webapp.filter.LazyInitRegistration.getInitHook(
	at org.camunda.bpm.spring.boot.starter.webapp.filter.LazyInitRegistration.lazyInit(
	at org.camunda.bpm.spring.boot.starter.webapp.filter.LazyDelegateFilter.init(
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(
	at org.apache.catalina.core.StandardContext.filterStart(
	at org.apache.catalina.core.StandardContext.startInternal(
	at org.apache.catalina.util.LifecycleBase.start(
	at org.apache.catalina.core.ContainerBase$
	at org.apache.catalina.core.ContainerBase$
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$

Any hints? Has anyone been able to successfully use devtools reload feature with camunda spring boot?

My environment: Gradle, Camunda 7.6 with Camunda Spring Boot Starter 2.1.2


Hi @tair ,
could you may be post the sample application? I’ve just tested - hot-restart works fine for me on this example on v.2.2.0:


Hi @sdorokhova,

I tried this one, added runtime 'org.springframework.boot:spring-boot-devtools' dependency, and it also fails with exception at reload


Hi @tair,

I tried and faced the same error. At the same time similar Maven project works fine ( Can’t actually say, why the problem happens, usually I’m not using Gradle .


Thank you @sdorokhova,

I really think there is some issue with camunda-gradle-spring-boot combination, because without camunda gradle + spring-boot reload is fine :frowning:


Hi @tair,

I’ve created the bug report for this issue:
Hopefully someone from community will be interested in researching and fixing this issue. Feel free to participate yourself :wink:


Hi @tair,
FYI the related issue was fixed.
It will be released in v. 2.3.0. You can check this GitHub commit:



Thanks for getting this done, @sdorokhova!


All the credits go to Camunda’s awesome community) Here is the original pull request:


Here is an easy workaround before release of 2.3.0:

@SpringBootApplication(exclude = CamundaBpmWebappAutoConfiguration.class)
public class CamundaApplication {...}

public class CustomCamundaBpmWebappAutoConfiguration extends CamundaBpmWebappAutoConfiguration {
    public LazyInitRegistration lazyInitRegistration() {
        return new LazyInitRegistration(){
            protected void onContextClosed(ContextClosedEvent ev) {
                APPLICATION_CONTEXT = null;