This is a common error which occurs when trying to compile a web project. This package is usually provided by the container. However, it is not (always) available at compile time and one should not include it in the final .war too.
If you are using Maven, the solution is simple. Add the following dependency with the provided scope: