I Got the solutions from log:
Log says:
2014-04-03 18:50:41.969:WARN::Failed startup of context org.mortbay.jetty.webapp.WebAppContext@58afc4dd{/SpringMVCRest,D:\Workspace\SpringMVCRest\WebContent} java.lang.IllegalStateException: Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml! at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:265) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:549) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at runjettyrun.Bootstrap.main(Bootstrap.java:97) 2014-04-03 18:50:42.047:INFO::Started SelectChannelConnector@0.0.0.0:8080
So I found 2 solutions:
- Remove the inheritance of ContextLoaderListener in my class.
- Keep the inheritance and remove entry of ContextLoaderListener from web.xml
Both worked for me.