I had the same problem and the problem was in the project properties.
Make sure you cannot see the server properties. To make them available, you can use “run as”, you need to access the project properties (right-click on the project), the project faces and select the dynamic web module.
In my case, after adding, everything worked fine. It is added to my build path (project properties / path / Java build libraries), web application libraries
source share