Failed to register 'filter errorPageFilterRegistration' when deploying flowable-rest.war in tomcat

187 views Asked by At

New flowable opensource 7.0 has only flowable-rest.war. But I can't get it running in tomcat 10 and JDK 17. It seems that flowable uses <spring.boot.version>3.1.3</spring.boot.version> Someone metioned some issue with spring boot 3.1.

How to fix "failed to register 'filter errorpagefilterregistration' on the servlet context. possibly already registered?"?

How to get this flowable running? Please help.

17-Oct-2023 15:06:36.019 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/10.1.15
17-Oct-2023 15:06:36.027 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Oct 11 2023 23:38:40 UTC
17-Oct-2023 15:06:36.028 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 10.1.15.0
17-Oct-2023 15:06:36.028 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 10
17-Oct-2023 15:06:36.028 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.0
17-Oct-2023 15:06:36.031 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
17-Oct-2023 15:06:36.035 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\myname\application\jdk-17.0.2
17-Oct-2023 15:06:36.036 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           17.0.2+8-86
17-Oct-2023 15:06:36.037 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
17-Oct-2023 15:06:36.037 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\myname\application\apache-tomcat-10.1.15
17-Oct-2023 15:06:36.037 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\myname\application\apache-tomcat-10.1.15
17-Oct-2023 15:06:36.048 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\myname\application\apache-tomcat-10.1.15\conf\logging.properties
17-Oct-2023 15:06:36.049 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
17-Oct-2023 15:06:36.049 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
17-Oct-2023 15:06:36.049 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
17-Oct-2023 15:06:36.050 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
17-Oct-2023 15:06:36.050 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
17-Oct-2023 15:06:36.051 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
17-Oct-2023 15:06:36.051 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
17-Oct-2023 15:06:36.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
17-Oct-2023 15:06:36.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\myname\application\apache-tomcat-10.1.15
17-Oct-2023 15:06:36.053 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\myname\application\apache-tomcat-10.1.15
17-Oct-2023 15:06:36.053 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\myname\application\apache-tomcat-10.1.15\temp
17-Oct-2023 15:06:36.060 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [2.0.6] using APR version [1.7.4].
17-Oct-2023 15:06:36.072 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.11 19 Sep 2023]
17-Oct-2023 15:06:36.365 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
17-Oct-2023 15:06:36.396 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [627] milliseconds
17-Oct-2023 15:06:36.489 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
17-Oct-2023 15:06:36.490 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.1.15]
17-Oct-2023 15:06:36.526 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\myname\application\apache-tomcat-10.1.15\webapps\flowable-rest.war]
17-Oct-2023 15:06:46.075 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
17-Oct-2023 15:06:58.745 INFO [main] liquibase.servicelocator.null Cannot load service: liquibase.license.LicenseService: Provider liquibase.license.pro.DaticalTrueLicenseService could not be instantiated
17-Oct-2023 15:06:59.004 INFO [main] liquibase.database.null Set default schema name to public
17-Oct-2023 15:06:59.155 INFO [main] liquibase.lockservice.null Successfully acquired change log lock
17-Oct-2023 15:07:00.570 INFO [main] liquibase.changelog.null Reading from public.flw_ev_databasechangelog
17-Oct-2023 15:07:00.738 INFO [main] liquibase.lockservice.null Successfully released change log lock
17-Oct-2023 15:07:00.835 INFO [main] liquibase.database.null Set default schema name to public
17-Oct-2023 15:07:00.850 INFO [main] liquibase.lockservice.null Successfully acquired change log lock
17-Oct-2023 15:07:01.433 INFO [main] liquibase.changelog.null Reading from public.act_dmn_databasechangelog
17-Oct-2023 15:07:01.465 INFO [main] liquibase.lockservice.null Successfully released change log lock
17-Oct-2023 15:07:01.735 INFO [main] liquibase.database.null Set default schema name to public
17-Oct-2023 15:07:01.751 INFO [main] liquibase.lockservice.null Successfully acquired change log lock
17-Oct-2023 15:07:02.286 INFO [main] liquibase.changelog.null Reading from public.act_cmmn_databasechangelog
17-Oct-2023 15:07:02.340 INFO [main] liquibase.lockservice.null Successfully released change log lock
17-Oct-2023 15:07:02.369 INFO [main] liquibase.database.null Set default schema name to public
17-Oct-2023 15:07:02.388 INFO [main] liquibase.lockservice.null Successfully acquired change log lock
17-Oct-2023 15:07:02.979 INFO [main] liquibase.changelog.null Reading from public.act_app_databasechangelog
17-Oct-2023 15:07:02.999 INFO [main] liquibase.lockservice.null Successfully released change log lock
17-Oct-2023 15:07:06.547 SEVERE [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [C:\myname\application\apache-tomcat-10.1.15\webapps\flowable-rest.war]
    java.lang.IllegalStateException: Error starting child
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:686)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:712)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:975)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1952)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:776)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1659)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:114)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:345)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:893)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:845)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:240)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:917)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/flowable-rest]]
        at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:186)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683)
        ... 37 more
    Caused by: org.springframework.context.ApplicationContextException: Unable to start web server
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:164)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:602)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:436)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
        at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:174)
        at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:154)
        at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:96)
        at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4850)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
        ... 38 more
    Caused by: java.lang.IllegalStateException: Failed to register 'filter errorPageFilterRegistration' on the servlet context. Possibly already registered?
        at org.springframework.boot.web.servlet.DynamicRegistrationBean.register(DynamicRegistrationBean.java:122)
        at org.springframework.boot.web.servlet.RegistrationBean.onStartup(RegistrationBean.java:52)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:236)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:192)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:161)
        ... 49 more
17-Oct-2023 15:07:06.551 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\myname\application\apache-tomcat-10.1.15\webapps\flowable-rest.war] has finished in [30,024] ms

When comparing with flowable 6.8, deployment completes with warning on filters.

   2023-10-17 16:24:06.286  INFO 15540 --- [           main] o.flowable.rest.app.ServletInitializer   : No active profile set, falling back to 1 default profile: "default"
    2023-10-17 16:24:07.271  INFO 15540 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 917 ms
    2023-10-17 16:24:07.358  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Filter errorPageFilter was not registered (possibly already registered?)
    2023-10-17 16:24:07.359  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Filter springSecurityFilterChain was not registered (possibly already registered?)
    2023-10-17 16:24:07.362  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Filter errorPageSecurityFilter was not registered (possibly already registered?)
    2023-10-17 16:24:07.363  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Servlet Flowable IDM Rest API was not registered (possibly already registered?)
    2023-10-17 16:24:07.364  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Servlet Flowable Form Rest API was not registered (possibly already registered?)
    2023-10-17 16:24:07.364  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Servlet Flowable Event Registry Rest API was not registered (possibly already registered?)
    2023-10-17 16:24:07.365  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Servlet Flowable DMN Rest API was not registered (possibly already registered?)
    2023-10-17 16:24:07.365  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Servlet Flowable Content Rest API was not registered (possibly already registered?)
    2023-10-17 16:24:07.366  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Servlet Flowable CMMN Rest API was not registered (possibly already registered?)
    2023-10-17 16:24:07.367  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Servlet Flowable App Rest API was not registered (possibly already registered?)
    2023-10-17 16:24:07.369  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Servlet Flowable External Job Rest API was not registered (possibly already registered?)
    2023-10-17 16:24:07.370  INFO 15540 --- [           main] o.s.boot.web.servlet.RegistrationBean    : Servlet Flowable BPMN Rest API was not registered (possibly already registered?)
    2023-10-17 16:24:07.432  INFO 15540 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@316ef28e, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@573fa580, org.springframework.security.web.context.SecurityContextPersistenceFilter@cf4d1ca, org.springframework.security.web.header.HeaderWriterFilter@61ea5a2f, org.springframework.security.web.authentication.logout.LogoutFilter@5f61b22e, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@304781b1, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6e9b6b4f, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5d137f91, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@5f73d1f, org.springframework.security.web.session.SessionManagementFilter@b8471c9, org.springframework.security.web.access.ExceptionTranslationFilter@4fcce3d, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@3a5d08f0]
    2023-10-17 16:24:07.636  INFO 15540 --- [           main] o.flowable.rest.app.ServletInitializer   : Started ServletInitializer in 1.421 seconds (JVM running for 29.684)
    17-Oct-2023 16:24:07.684 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\myname\application\apache-tomcat-9.0.79\webapps\flowable-rest] has finished in [27,029] ms
2

There are 2 answers

0
Tebogo On

I had the same issue and couldn't resolve it, I ended up using docker image instead which comes bundled with tomcat. Just a suggestion

https://hub.docker.com/u/flowable

1
Lenin chakravarthy Kuppannan On

Remove

extends ServletInitializer (or) SpringBootServletInitializer

from spring boot main application class.

@SpringBootApplication
public class mySBApp /*extends ServletInitializer */ {

}

this worked for me.

SB Version: 3.1.9