防止重复加载“Spring root WebApplicationContext ”

tomcat - server.xml

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" 
	    xmlNamespaceAware="false"
	    URIEncoding="UTF-8">
	<Context path="/" docBase="xxx" 
		 reloadable="false"
		 URIEncoding="UTF-8"/>

改为:
<Host name="localhost"  appBase=""
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" 
	    xmlNamespaceAware="false"
	    URIEncoding="UTF-8">
	<!-- docBase 设置为真实路径,否则会重复 Loading Spring root WebApplicationContext-->
	<Context path="/" docBase="/home/mg/opt/tomcat/webapps/xxx" 
		 reloadable="false"
		 URIEncoding="UTF-8"/>


注:/home/mg/opt/tomcat - 为tomcat的安装目录

你可能感兴趣的:(java,spring,tomcat,linux,xml)