spring cannot be cast to javax.servlet.Servlet code example Example: java.lang.ClassCastException: cannot be cast to javax.servlet.Servlet public class Customer extends HttpServlet