The type javax.servlet.ServletException cannot be resolved. It is indirectly referenced from required .class files by Please add below dependency. javax.servlet javax.servlet-api 3.1.0 provided