CMDBuild Forum

CMDBuild 4.0 Startup error "DelegatingFilterProxy cannot be cast to class javax.servlet.Filter"

Hi,
after running cmdbuild 4.0.0 as webapp in tomcat server, i get the following error:

14-Apr-2025 09:46:21.973 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [mobileLoginFilter]
        java.lang.ClassCastException: class org.springframework.web.filter.DelegatingFilterProxy cannot be cast to class javax.servlet.Filter (org.springframework.web.filter.DelegatingFilterProxy is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @1213ffbc; javax.servlet.Filter is in unnamed module of loader java.net.URLClassLoader @5a2e4553)
                at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:224)
                at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:97)
                at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3856)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4474)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:599)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:571)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:603)
                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1175)
                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1888)
                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.deployDirectories(HostConfig.java:1086)
                at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
                at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1584)
                at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:312)
                at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:109)
                at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:385)
                at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:332)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:776)
                at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:721)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193)
                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:749)
                at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:211)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
                at org.apache.catalina.core.StandardService.startInternal(StandardService.java:415)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
                at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:878)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
                at org.apache.catalina.startup.Catalina.start(Catalina.java:735)
                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:569)
                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)

I tried to change server.xml in the WEB-INF folder but could not fix this and generally tried for hours finding the issue for this. I also found that changing the tomcat instance to tomcat10 instead of tomcat9 (as is shipped with cmdbuild4.0.0.sh although tomcat10 is ā€œrequiredā€?) did not solve the issue

Anyone else having this issue?

Is no one else having this issue? I don’t know what my local config / installations could have to do with it - i’m just installing from the .sh/.war file and this always happens

Yes,
I have the exact same problem,
but I haven’t been able to fix it so far.

1 Like

I’m in a similar pickle - I tried the documented process of:

  • stopping Tomcat (did Postgres as well)
  • deleting the webapps/cmdbuilddev directory and .WAR file
  • then copying in the new .WAR file and starting up Postgres and Tomcat.

Almost always fails to start (I’ve had a few bizarre attempts that seemed to work but I no longer trust my memory and worry I’d copied in the 3.4.4 .WAR file during ā€˜a senior moment’).

I may have overcomplicated things by having both a dev and test instance within the same Tomcat install in my VM.

I was thinking I ought to look at upgrading the dependencies, particularly Tomcat and Postgres but haven’t gotten back to it

CMDBuild 4.0 requires Tomcat 10.
Make sure to set the appropriate JVM options using CATALINA_OPTS:

CATALINA_OPTS="$CATALINA_OPTS \
  --add-opens=java.base/java.nio=ALL-UNNAMED \
  --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \
  --add-opens=java.base/java.util.stream=ALL-UNNAMED"

This configuration is necessary due to module access restrictions introduced in recent Java versions.

Thanks for the clarification!

did this fix it for you? and if so, could you maybe give small hints what you did differently than usually? I tried with tomcat10 and these options, but still got the same problem…

Please ensure that you are using Java 17.

Yes it has worked, sorta.

I went straight to Tomcat 11 on a whim, using

sudo tar xzvf /home/{user}/apache-tomcat-11*tar.gz -C /opt/tomcat --strip-components=1

In my instance I have a single tomcat install running both a dev and test CMDBuild instance. I probably should’ve purged all of the /opt/tomcat directory but untarred v11 over the top of what I had, for better or worse.

Tomcat spun up happily and the host page indicated v11. I’ve had to remove the cmdbuilddev directory and .WAR file and then copying the new v4.0 .WAR file in triggered the ingestion and starting of the /cmdbuild website.

  • I have seen it prompt a few times to apply patches.
  • It connected to the postgres database as expected.
  • The cmdbuildtest instance hasn’t been touched yet, so tomcat struggles to start that currently.
  • I’ve had to re-incorporate our PKI certificates and various other configuration settings like blocking http.

I’m now grappling with issues where my LDAP searching isn’t working (so AD domain account authentication is broken and only local accounts work). It’s perplexing because because the content in /opt/tomcat/conf/cmdbuilddev/auth.conf matches my production servers /opt/tomcat/conf/cmdbuild/auth.conf content :frowning:

Early days, though!

Interestingly I have the same issue now!
For me it worked after installing complete new instance of tomcat10 and then unpacking the war, and then adding the CATALINA_OPTS provided by @tecnoteca.
The main problem I had was with my SSL config, because copying the old one didnt work, because now you have to provide the ssl config in a different way in tomcat10.

Now it works and I can login using the local admin account of cmdbuild but LDAP doesnt work anymore, and I have no clue why honestly… let me know when you figure out why, I’ll also keep you updated once LDAP works again