我的应用程序非常庞大,例如在web-inf/lib中包含310个jar,总共100Mb.启动服务器,此步骤需要13秒:
Sep 16, 2014 1:05:33 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.47\webapps\ROOT
Run Code Online (Sandbox Code Playgroud)
应用程序依赖于Web片段和注释来正确启动.
我尝试了以下内容以跳过13s扫描时间:
修改 conf/context.xml with attribute logEffectiveWebXml="true"
catalina run 2> web-complete.log
从中提取web.xml片段web-complete.log,将其保存在下webapps\ROOT\web-inf\web.xml
如果我开始申请,我仍然会看到13秒的扫描时间.在上面的snipet中,metadata-complete已经设置为"true".
将以下语句添加到web.xml后,完全跳过13s,但这次我的应用程序无法再启动:
<absolute-ordering />
Run Code Online (Sandbox Code Playgroud)
1)在我的情况下,使tomcat快速启动的正确方法是什么?
2)你能解释为什么元数据完整对13s没有帮助吗?
3)Altough我的web.xml完成后,为什么不允许应用程序启动?
谢谢,