I followed the steps in BalusC’s answer at JSF 2.0 File upload. The only step in which I went differently is the Tomahawk upload link in the answer. The link is broken, so I got tomahawk-1.1.11 from another place. When I try to start Tomcat 7.0.14 from Eclipse I get the following error:
java.lang.NoSuchMethodError:
javax.servlet.ServletContext.getServletRegistrations()Ljava/util/Map;
And Tomcat doesn’t start. Any ideas? Also, the answer in the link is from March. Any developments with file upload in JSF 2?
The
/WEB-INF/libof your web project is cluttered with servletcontainer-specific libraries of a container of a different make/version, such asservlet-api.jar,javaee.jar, etc. Get rid of them.The mentioned method is introduced in Servlet 3.0 and this error indicates that you’ve libraries of a Servlet 2.5 container or older in your
/WEB-INF/lib. If you have included them to circumvent Eclipse’s compilation errors onjavax.servlet.*imports, then you should have solved it differently. Namely, by integrating the servletcontainer which you’re actually going to use (which is Tomcat 7 in your case) as target runtime in Eclipse and associating the project with it.Please note that this problem is not related to JSF 2.0. You got an exception pointing to a method of the
javax.servletpackage, notjavax.facespackage.See also: