# Error running flowable in a local machine

**URL:** <https://forum.flowable.org/t/error-running-flowable-in-a-local-machine/12405>\
**Category:** Flowable Engine\
**Created:** [August 27, 2025, 2:24am UTC](https://forum.flowable.org/t/error-running-flowable-in-a-local-machine/12405 "2025-08-27T02:24:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dchikaka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/dchikaka/32/3759_2.png) [@dchikaka](https://forum.flowable.org/u/dchikaka)\
**Post date:** [August 27, 2025, 2:24am UTC](https://forum.flowable.org/t/error-running-flowable-in-a-local-machine/12405/1 "2025-08-27T02:24:16Z")

</div>

Hello,

I have installed flowable using springboot and it gives the following error:  
`Consider defining a bean of type 'org.flowable.engine.IdentityService' in your configuration.`

```auto
My main class: package com.example.flowable_app;

```

```auto

```

```auto
import org.flowable.engine.IdentityService;

```

```auto
import org.flowable.idm.api.Group;

```

```auto
import org.flowable.idm.api.User;

```

```auto
import org.slf4j.Logger;

```

```auto
import org.slf4j.LoggerFactory;

```

```auto
import org.springframework.boot.CommandLineRunner;

```

```auto
import org.springframework.boot.SpringApplication;

```

```auto
import org.springframework.boot.autoconfigure.SpringBootApplication;

```

```auto
import org.springframework.context.annotation.Bean;

```

```auto

```

```auto
@SpringBootApplication

```

```auto
public class FlowableAppApplication {

```

```auto

```

```auto
    private static final Logger logger = LoggerFactory.getLogger(FlowableAppApplication.class);

```

```auto

```

```auto
    public static void main(String[] args) {

```

```auto
        SpringApplication.run(FlowableAppApplication.class, args);

```

```auto
    }

```

```auto

```

```auto
    @Bean

```

```auto
    public CommandLineRunner initUsersAndGroups(IdentityService identityService) {

```

```auto
        return args -> {

```

```auto
            try {

```

```auto
                // Check if any users exist to avoid re-initialization

```

```auto
                if (identityService.createUserQuery().count() == 0) {

```

```auto
                    logger.info("Initializing users and groups...");

```

```auto

```

```auto
                    // Create Groups

```

```auto
                    createGroupIfNotExists(identityService, "employees", "Employees");

```

```auto
                    createGroupIfNotExists(identityService, "supervisors", "Supervisors");

```

```auto
                    createGroupIfNotExists(identityService, "hrs", "HRs");

```

```auto
                    createGroupIfNotExists(identityService, "finances", "Finances");

```

```auto

```

```auto
                    // Create Users and Assign to Groups

```

```auto
                    createUserAndAssignGroup(identityService, "employee", "password", "employees");

```

```auto
                    createUserAndAssignGroup(identityService, "supervisor", "password", "supervisors");

```

```auto
                    createUserAndAssignGroup(identityService, "hr", "password", "hrs");

```

```auto
                    createUserAndAssignGroup(identityService, "finance", "password", "finances");

```

```auto

```

```auto
                    // Admin User for REST API Access (no group assignment)

```

```auto
                    createUserAndAssignGroup(identityService, "admin", "test", null);

```

```auto

```

```auto
                    logger.info("Users and groups initialized successfully.");

```

```auto
                } else {

```

```auto
                    logger.info("Users already exist, skipping initialization.");

```

```auto
                }

```

```auto
            } catch (Exception e) {

```

```auto
                logger.error("Failed to initialize users and groups: {}", e.getMessage(), e);

```

```auto
                throw new RuntimeException("Initialization of users and groups failed", e);

```

```auto
            }

```

```auto
        };

```

```auto
    }

```

```auto

```

```auto
    private void createGroupIfNotExists(IdentityService identityService, String id, String name) {

```

```auto
        Group existingGroup = identityService.createGroupQuery().groupId(id).singleResult();

```

```auto
        if (existingGroup == null) {

```

```auto
            Group group = identityService.newGroup(id);

```

```auto
            group.setName(name);

```

```auto
            group.setType("security-role");

```

```auto
            identityService.saveGroup(group);

```

```auto
            logger.info("Created group: {} ({})", name, id);

```

```auto
        } else {

```

```auto
            logger.debug("Group {} ({}) already exists", name, id);

```

```auto
        }

```

```auto
    }

```

```auto

```

```auto
    private void createUserAndAssignGroup(IdentityService identityService, String username, String password, String groupId) {

```

```auto
        User existingUser = identityService.createUserQuery().userId(username).singleResult();

```

```auto
        if (existingUser == null) {

```

```auto
            User user = identityService.newUser(username);

```

```auto
            user.setPassword(password); // Flowable hashes the password

```

```auto
            identityService.saveUser(user);

```

```auto
            logger.info("Created user: {}", username);

```

```auto
        } else {

```

```auto
            logger.debug("User {} already exists", username);

```

```auto
        }

```

```auto

```

```auto
        if (groupId != null) {

```

```auto
            long membershipCount = identityService.createGroupQuery()

```

```auto
                    .groupId(groupId)

```

```auto
                    .groupMember(username)

```

```auto
                    .count();

```

```auto
            if (membershipCount == 0) {

```

```auto
                identityService.createMembership(username, groupId);

```

```auto
                logger.info("Assigned user {} to group {}", username, groupId);

```

```auto
            } else {

```

```auto
                logger.debug("User {} is already a member of group {}", username, groupId);

```

```auto
            }

```

```auto
        }

```

```auto
    }

```

```auto
}

```

```auto
my pom: <?xml version="1.0" encoding="UTF-8"?>

```

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

```

```auto
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

```

```auto
	<modelVersion>4.0.0</modelVersion>

```

```auto
	<parent>

```

```auto
		<groupId>org.springframework.boot</groupId>

```

```auto
		<artifactId>spring-boot-starter-parent</artifactId>

```

```auto
		<version>3.5.5</version>

```

```auto
		<relativePath/> <!-- lookup parent from repository -->

```

```auto
	</parent>

```

```auto
	<groupId>com.example</groupId>

```

```auto
	<artifactId>flowable-app</artifactId>

```

```auto
	<version>0.0.1-SNAPSHOT</version>

```

```auto
	<name>flowable-app</name>

```

```auto
	<description>Demo project for Flowable using Springboot</description>

```

```auto
	<url/>

```

```auto
	<licenses>

```

```auto
		<license/>

```

```auto
	</licenses>

```

```auto
	<developers>

```

```auto
		<developer/>

```

```auto
	</developers>

```

```auto
	<scm>

```

```auto
		<connection/>

```

```auto
		<developerConnection/>

```

```auto
		<tag/>

```

```auto
		<url/>

```

```auto
	</scm>

```

```auto
    <properties>

```

```auto
        <java.version>17</java.version>

```

```auto
        <flowable.version>7.2.0</flowable.version>

```

```auto
    </properties>

```

```auto

```

```auto
    <dependencies>

```

```auto
        <dependency>

```

```auto
            <groupId>org.springframework.boot</groupId>

```

```auto
            <artifactId>spring-boot-starter-web</artifactId>

```

```auto
        </dependency>

```

```auto
        <dependency>

```

```auto
            <groupId>org.springframework.boot</groupId>

```

```auto
            <artifactId>spring-boot-starter-data-jpa</artifactId>

```

```auto
        </dependency>

```

```auto
        <dependency>

```

```auto
            <groupId>com.h2database</groupId>

```

```auto
            <artifactId>h2</artifactId>

```

```auto
            <scope>runtime</scope>

```

```auto
        </dependency>

```

```auto
        <!-- Flowable Starters -->

```

```auto
        <dependency>

```

```auto
            <groupId>org.flowable</groupId>

```

```auto
            <artifactId>flowable-spring-boot-starter</artifactId>

```

```auto
            <version>${flowable.version}</version>

```

```auto
        </dependency>

```

```auto
        <dependency>

```

```auto
            <groupId>org.flowable</groupId>

```

```auto
            <artifactId>flowable-spring-boot-starter-process-rest</artifactId>

```

```auto
            <version>${flowable.version}</version>

```

```auto
        </dependency>

```

```auto
        <!-- Spring Security for Basic Auth -->

```

```auto
        <dependency>

```

```auto
            <groupId>org.springframework.boot</groupId>

```

```auto
            <artifactId>spring-boot-starter-security</artifactId>

```

```auto
        </dependency>

```

```auto
        <!-- HTTP Client for Spring Boot App -->

```

```auto
        <dependency>

```

```auto
            <groupId>org.apache.httpcomponents</groupId>

```

```auto
            <artifactId>httpclient</artifactId>

```

```auto
            <version>4.5.14</version>

```

```auto
            <scope>runtime</scope>

```

```auto
        </dependency>

```

```auto
        <dependency>

```

```auto
    		<groupId>org.springframework.boot</groupId>

```

```auto
    		<artifactId>spring-boot-starter-test</artifactId>

```

```auto
    		<scope>test</scope>

```

```auto
		</dependency>

```

```auto
		<dependency>

```

```auto
    		<groupId>org.flowable</groupId>

```

```auto
    		<artifactId>flowable-spring-boot-starter-process</artifactId>

```

```auto
    		<version>${flowable.version}</version>

```

```auto
		</dependency>

```

```auto

```

```auto
    </dependencies>

```

```auto

```

```auto
    <build>

```

```auto
        <plugins>

```

```auto
            <plugin>

```

```auto
                <groupId>org.springframework.boot</groupId>

```

```auto
                <artifactId>spring-boot-maven-plugin</artifactId>

```

```auto
            </plugin>

```

```auto
        </plugins>

```

```auto
    </build>

```

```auto

```

```auto
    <repositories>

```

```auto
        <repository>

```

```auto
            <id>central</id>

```

```auto
            <url></url>

```

```auto
        </repository>

```

```auto
        <repository>

```

```auto
            <id>flowable</id>

```

```auto
            <url>https://maven.flowable.org/releases</url>

```

```auto
        </repository>

```

```auto
    </repositories>

```

```auto

```

```auto
</project>

```

```auto

```

my application.properties

```auto
spring.application.name=flowable-app

```

```auto
logging.level.org.springframework.boot=DEBUG

```

```auto

```

```auto

```

```auto
spring.datasource.url=jdbc:h2:mem:flowable;DB_CLOSE_DELAY=-1

```

```auto
spring.datasource.driver-class-name=org.h2.Driver

```

```auto
spring.datasource.username=sa

```

```auto
spring.datasource.password=

```

```auto
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect

```

```auto
spring.jpa.hibernate.ddl-auto=update

```

```auto
spring.sql.init.enabled=true

```

```auto

```

```auto
flowable.idm.enabled=true

```

```auto
flowable.process.enabled=true

```

```auto
flowable.rest-api-enabled=true

```

```auto

```

```auto
spring.jpa.hibernate.ddl-auto=none

```

```auto
flowable.database-schema-update=true

```

```auto

```

```auto

```

```auto
server.port=8080

```

```auto

```

```auto
flowable.idm.app.admin.user-id=admin

```

```auto
flowable.idm.app.admin.password=test

```

```auto
flowable.idm.app.admin.first-name=Admin

```

```auto
flowable.idm.app.admin.last-name=Admin

```

[flowable.idm.app.admin.email=admin@flowable.org](mailto:flowable.idm.app.admin.email=admin@flowable.org)

```auto

```

```auto
flowable.database-schema-update Ascertain

```

```auto
logging.level.org.flowable=DEBUG

```
