Here are several approaches you could try to diagnose and possibly resolve the
problem:
1. Check Tomcat Version Compatibility: Ensure that the Tomcat 9
version you’re using is fully compatible with the version of the JDK configured
in NetBeans and the JDK used by Tomcat itself.
I have two web app projects in NB21. One app installs to the Tomcat 9 that
I use for development, and it runs fine. However the second app will not
install, although it uses similar run configuration settings.
My NetBeans info is
*Product Version:* Apache NetBeans IDE 21
*Java:* 17.0.9; OpenJDK