Choose unique values for the ‘webAppRootKey’ context-param in your web.xml files!

You will have this issue when you are running multiple Spring webapplications in the same container.


java.lang.IllegalStateException: Web app root system property
already set to different value: 'webapp.root' =
[/tmp/jetty-0.0.0.0-8080-springdemo.war-_springdemo-any-/webapp]
instead of [/tmp/jetty-0.0.0.0-8080-greeting.war-_greeting-any-/webapp]
- Choose unique values for the 'webAppRootKey' context-param in
your web.xml files!

In Spring the webAppRootKey has a default value, which in this case obviously is the same for both applications.

Solve this by specifying the contextparam in your web.xml:


<context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>specify.a.value.here</param-value>
</context-param>