I had the same issue, and I fixed it. Please follow the steps below, and you can create your war file.
- Right-click on folder project.
- Click on properties.
- Go to project facets.
- Activate, if necessary.
- Scroll down to Configuration and mark Dynamic Web Module.