Shutdown policy

Hello,
when shutdown my process application i am facing 2 errors.

The first error resides to camunda process engine - somehow i want that when shuting down that my application and also all processes which have been deployed earlier are getting deleted. How is this possible?

My application.yaml looks like this:

The second problem is also about shuting down my application because here i am always facing a MojoExecutionException but i don’t know why. (checked all dependency – read that it came from a false configuration of a plugin or so on…but i didn’t found a proper solution for that)

Error looks like this:

My pom.xml file looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.example.workflow</groupId>
  <artifactId>camunda-init4</artifactId>
  <version>1.0.0-SNAPSHOT</version>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>14</maven.compiler.source>
    <maven.compiler.target>14</maven.compiler.target>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>2.7.3</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-bom</artifactId>
        <version>7.18.0</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
      <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine-plugin-spin</artifactId>
    </dependency>
    

    <dependency>
      <groupId>org.camunda.spin</groupId>
      <artifactId>camunda-spin-dataformat-all</artifactId>
    </dependency>

     <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
    </dependency>

   <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    
    <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-amqp</artifactId>
      </dependency>

<dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.25</version>
    </dependency>
    
	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<version>1.18.24</version>
		<scope>provided</scope>
	</dependency>

      
      <!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
    <groupId>org.json</groupId>
    <artifactId>json</artifactId>
    <version>20160810</version>
</dependency>
      

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>2.7.3</version>
      </plugin>
    </plugins>
  </build>

</project>

Thanks for any advice.
Regards Sebastian

Hi Sebastian,

Your process instances are getting deleted during engine shut down, is that correct?

The second problem is also about shuting down my application because here i am always facing a MojoExecutionException but i don’t know why. (checked all dependency – read that it came from a false configuration of a plugin or so on…but i didn’t found a proper solution for that)

The error looks like spring or spring boot related. It doesn’t seem to be related to Camunda engine.
Nevertheless how do you start your application?

Hey
no also my process instances doesn’t gets deleted. Is there any command which i need to specify in configuration file or so?

Thanks ok i solved the second error by downgrading java.

Hi @SebastianAT

You could change the H2 connection string to be memory based. This would mean that ALL data (process definitions and process instances etc) is removed when the applications is shut down.

When the application starts again you would be like starting from a fresh Camunda DB.

Is that what you are looking for?

Hope that helps.

BR
Michael

1 Like

Thanks this is working as expected.

Now, there is only one thing left.
Why i am always facing an error (build failure) when i shutdown?

Do you have any clou?

Hi @SebastianAT

Not from the stacktrace you have attached.
Are you running it from inside an IDEA?
Have you tried running the app from the command line (java -jar etc)?

You could try to Google it - there are different possible causes that you could check up on.

BR
Michael