I am creating an SpringBoot REST application (using Gradle). It works fine from my Eclipse. When I take the build and run the JAR I'm getting the following error:
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]
Using jetty server, servlet-api2.5 and jdk1.7
Can anyone please help me resolve this?