我们在tomcat引擎上有一组正在运行的servlet.当我们编译一个java文件并构建war时,tomcat需要不确定的时间来重新加载它.有时3秒,有时30秒等.当前的解决方法是停止tomcat并使用shell脚本重新启动它.我们将autodeploy和reloadable标志设置为true,但它无法正常工作.知道如何实现这一目标吗?指针也很受欢迎.这是关于ubuntu的tomcat v6.0.20.
这是我们的conf/server.xml文件的摘录:
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<DefaultContext reloadable="true">
</DefaultContext>
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
</Host>
</Engine>
Run Code Online (Sandbox Code Playgroud)
一种可能性是向Tomcat Manager App发送适当的请求; 例如:
http://localhost:8080/manager/text/reload?path=/examples
Run Code Online (Sandbox Code Playgroud)