# Problem running Flowable UI with Keycloak setup

**URL:** <https://forum.flowable.org/t/problem-running-flowable-ui-with-keycloak-setup/12094>\
**Category:** Flowable Engine\
**Created:** [February 26, 2025, 6:42am UTC](https://forum.flowable.org/t/problem-running-flowable-ui-with-keycloak-setup/12094 "2025-02-26T06:42:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmanzur](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@mmanzur](https://forum.flowable.org/u/mmanzur)\
**Post date:** [February 26, 2025, 6:42am UTC](https://forum.flowable.org/t/problem-running-flowable-ui-with-keycloak-setup/12094/1 "2025-02-26T06:42:52Z")

</div>

Dear all,

After downloading version 6.8 of Flowable from GitHub, I ran it without modifications, and it worked correctly. I was able to access _flowable-ui_ and use the available applications without any issues.

Then, I applied the configuration from this [link](https://www.flowable.com/blog/engineering/whats-new-with-the-open-source-flowable-ui-apps) to integrate Keycloak into the system.

I followed each step without any problems, but when I tried to restart _flowable-ui_, I encountered the following error:

```auto
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2025-02-15 14:03:33.306 ERROR 15996 --- [main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/oauth2/server/resource/web/authentication/BearerTokenAuthenticationFilter
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.25.jar!/:5.3.25]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.25.jar!/:5.3.25]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.8.jar!/:2.7.8]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.8.jar!/:2.7.8]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.8.jar!/:2.7.8]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.8.jar!/:2.7.8]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.8.jar!/:2.7.8]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.8.jar!/:2.7.8]
        at org.flowable.ui.application.FlowableUiApplication.main(FlowableUiApplication.java:27) ~[classes!/:6.8.1.36]
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:578) ~[na:na]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[flowable-ui.war:6.8.1.36]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[flowable-ui.war:6.8.1.36]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[flowable-ui.war:6.8.1.36]
        at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59) ~[flowable-ui.war:6.8.1.36]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/oauth2/server/resource/web/authentication/BearerTokenAuthenticationFilter
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.25.jar!/:5.3.25]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.25.jar!/:5.3.25]
        ... 27 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/security/oauth2/server/resource/web/authentication/BearerTokenAuthenticationFilter
        at org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer.configure(OAuth2ResourceServerConfigurer.java:272) ~[spring-security-config-5.8.2.jar!/:5.8.2]
        at org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer.configure(OAuth2ResourceServerConfigurer.java:149) ~[spring-security-config-5.8.2.jar!/:5.8.2]
        at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.configure(AbstractConfiguredSecurityBuilder.java:349) ~[spring-security-config-5.8.2.jar!/:5.8.2]
        at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:303) ~[spring-security-config-5.8.2.jar!/:5.8.2]
        at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38) ~[spring-security-config-5.8.2.jar!/:5.8.2]
        at org.springframework.security.config.annotation.web.builders.WebSecurity.performBuild(WebSecurity.java:313) ~[spring-security-config-5.8.2.jar!/:5.8.2]
        at org.springframework.security.config.annotation.web.builders.WebSecurity.performBuild(WebSecurity.java:88) ~[spring-security-config-5.8.2.jar!/:5.8.2]
        at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:305) ~[spring-security-config-5.8.2.jar!/:5.8.2]
        at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38) ~[spring-security-config-5.8.2.jar!/:5.8.2]
        at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:125) ~[spring-security-config-5.8.2.jar!/:5.8.2]
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:578) ~[na:na]
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.25.jar!/:5.3.25]
        ... 28 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.security.oauth2.server.resource.web.authentication.BearerTokenAuthenticationFilter
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[na:na]
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) ~[na:na]
        at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) ~[flowable-ui.war:6.8.1.36]
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
        ... 41 common frames omitted

```

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/3/32c1e9db42917cb4969c2b6f3acd2c65d45bfeec.png)

I checked inside the WAR file, and the library containing the mentioned class is present.

Does anyone have any idea what might be causing this issue?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Pavelevich](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/pavelevich/32/3654_2.png) [@Pavelevich](https://forum.flowable.org/u/Pavelevich)\
**Post date:** [February 27, 2025, 3:25pm UTC](https://forum.flowable.org/t/problem-running-flowable-ui-with-keycloak-setup/12094/2 "2025-02-27T15:25:31Z")

</div>

I was having that same problem, but it turned out to be a mismatch in the spring security OAuth2 resource server dependency, once I aligned the versions with Flowable’s (ensuring `spring-security-oauth2-resource-server` matched the same Spring Security version), everything worked fine, gut luck

---

<div class="post-metadata">

**Author:** ![mmanzur](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@mmanzur](https://forum.flowable.org/u/mmanzur)\
**Post date:** [March 9, 2025, 10:49pm UTC](https://forum.flowable.org/t/problem-running-flowable-ui-with-keycloak-setup/12094/3 "2025-03-09T22:49:25Z")

</div>

Hello, thank you for your response. Based on your input, I was able to successfully get **flowable-ui** running. The issue was resolved by modifying the following section in the `pom.xml` file of **flowable-ui-parent** :

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/f/f205237f727046a07a5d4e6ffc0cf0260f56f8c5.png)

```auto
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-bom</artifactId>
            <version>${spring.security.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

```

After making this change, I rebuilt the package, and the application started successfully.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/d/d669d1419d69900ce27330251a1ffae38ef393e3.png)

However, after logging in, I encountered another error:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/5/5c34a3959aed110f608a5e84ca312668fca3db87.png)

I will investigate this issue further, and if necessary, I will open a new thread in the forum.

Thanks for your help!
