SpringBoot项目打成war包在tomcat中启动两次原因及解决方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012759397/article/details/82770368

笔者新建了一个QQ群:571278542 。欢迎大家加入!
tomcat重启两次的原因是appBase和Context中docBase设置的值导致的,只需要把appBase置为空,docBase写项目的绝对路径就可以了,代码如下:

      <Host name="localhost"  appBase=""
            unpackWARs="true" autoDeploy="true">
		<Context path="/" docBase="F:/Tomcat8.5/webroot/taocloud" debug="0"/>
        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
展开阅读全文

没有更多推荐了,返回首页