我正在创建一个SpringBoot REST应用程序(使用Gradle)。我的Eclipse工作正常。当我接受构建并运行JAR时,我收到以下错误:
java.lang.NoSuchMethodError:
javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:626)
~[spring-webmvc-3.2.0.RELEASE.jar!/:3.2.0.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:598)
~[spring-webmvc-3.2.0.RELEASE.jar!/:3.2.0.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:661)
~[spring-webmvc-3.2.0.RELEASE.jar!/:3.2.0.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:517)
~[spring-webmvc-3.2.0.RELEASE.jar!/:3.2.0.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:458)
~[spring-webmvc-3.2.0.RELEASE.jar!/:3.2.0.RELEASE]
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:138)
~[spring-webmvc-3.2.0.RELEASE.jar!/:3.2.0.RELEASE]
使用jetty服务器,servlet-api2.5和jdk1.7
任何人都可以帮我解决这个问题吗?