Can't login to camunda in Spring boot web-app

Hi,
I am new to camunda and wanna use it for our spring boot application.
I created spring boot startup project from start.camunda.com. But I can’t login to welcome page.

Are there any people having the same issue?

Hey @dhluong90,

Welcome to the forum!

Did you specify the password and username you tried (demo/demo) at start.camunda.com? How does your application.yaml file look like?

You need to specify the initial admin user in the application.yaml. For more information on how to configure the engine with Spring Boot have a look in the docs.

Cheers,
Miklas

Hi Miklas,

Thanks Miklas ^^.

yes I have configed already.

Was it configured like this from the start? Deleting camunda-h2-database.mv.db from the project root should allow you a reset.Does the issue persist?

The user creation on a fresh DB during startup looks like this:

…INFO org.camunda.bpm.spring.boot - STARTER-SB010 creating initial Admin User: AdminUserProperty[id=demo, firstName=Demo, lastName=Demo, email=demo@localhost,password=******]

It is working well on

Spring-Boot: (v2.2.1.RELEASE)
Camunda BPM: (v7.12.0)
Camunda BPM Spring Boot Starter: (v3.4.1)

@rob2universe, I was checking with this version:

Spring Boot Version = 'v2.2.1.RELEASE’
Camunda BPM Starter Version = 'v3.4.0’
Camunda BPM Version = 'v7.12.0’

@rob2universe i can see starter version difference is 3.4.0 which i used, and yours is 3.4.1. So i updated starters to 3.4.1 version, but even it didn’t create the admin user by default. It always redirects to me this admin-user setup page.

Can you switch to an application.properties:

spring.datasource.url= jdbc:h2:file:./camunda-h2-database
camunda.bpm.admin-user.id= demo
camunda.bpm.admin-user.password= demo

and see if it changes?

Both works on my end.

@dhluong90 can you also double-check if your application.yaml is in the correct folder (src/main/resources)?

The startup would also contain:

CreateAdminUserConfiguration[adminUser=AdminUserProperty[id=demo, firstName=Demo, lastName=Demo, email=demo@localhost, password=******]]

it doesn’t worked for me, after switching to an application.properties

Also, i didn’t see this log in application startup

Hihi,

After I delete h2 db file and restart, it’s working.
I have tried multiple times with many different options, still don’t understand why it didn’t work.
Thanks all help.

1 Like

@rob2universe, i’m not using built-in spring datasource, i was creating a datasource through apache commons dbcp.

<dependency>
   <groupId>org.apache.commons</groupId>
   <artifactId>commons-dbcp2</artifactId>
   <version>2.7.0</version>
</dependency>

Datasource will be created like this:

BasicDataSource dbcpDataSource = new BasicDataSource(); 
dbcpDataSource.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED;
dbcpDataSource.setUrl(dbConfig.getDburl());
dbcpDataSource.setUsername(dbConfig.getDbusername());
dbcpDataSource.setPassword(dbConfig.getDbpassword());

And the transaction manager is DataSourceTransactionManager implementation of PlatformTransactionManager.

  @Bean(name = "transactionManager")
  public PlatformTransactionManager transactionManager(@Qualifier("dataSource") DataSource dataSource) {
    DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
    transactionManager.setDataSource(dataSource);
    return transactionManager;
  }

remove in pom.xml,
dependency of spring-security