问题描述
一个javaweb项目,客户追加了一些功能(v4.0),在原来的环境中老版本(v3.0)还要运行,新版本和旧版本的发布目录是平行的。以下是生产环境的一些信息:------------------------------------------------------UsingCATALINA_BASE:/xxx/apache-tomcat-5.5.33UsingCATALINA_HOME:/xxx/apache-tomcat-5.5.33UsingCATALINA_TMPDIR:/xxx/apache-tomcat-5.5.33/tempUsingJRE_HOME:/xxx/jdk1.5.0_20UsingCLASSPATH:/xxx/apache-tomcat-5.5.33/bin/bootstrap.jarServerversion:ApacheTomcat/5.5.33Serverbuilt:Feb8201105:13:31Servernumber:5.5.33.0OSName:LinuxOSVersion:2.6.32-279.el6.i686Architecture:i386JVMVersion:1.5.0_20-b02JVMVendor:SunMicrosystemsInc.-------------------------------------------------旧版本系统路径:/xxx/stastt3/WebContent新版本系统路径:/xxx/stastt/WebContent新旧版本的系统里面的文件目录结构都是完全一样的,新版本只是追加了一点功能。/xxx/apache-tomcat-5.5.33/conf/Catalina/localhost下有2个配置文件:1.stastt.xml<?xmlversion="1.0"encoding="UTF-8"?><ContextdocBase="/xxx/stastt/WebContent"reloadable="true"workDir="/xxx/stastt/WebContent/WEB-INF/classes"></Context>2.stastt3.xml<?xmlversion="1.0"encoding="UTF-8"?><ContextdocBase="/xxx/stastt3/WebContent"reloadable="true"workDir="/xxx/stastt3/WebContent/WEB-INF/classes"></Context>现在的问题是启动tomcat后,只有一个应用可以用如果删除掉stastt.xml,则stastt3可用,反之亦然。错误log如下:2014-8-302:28:45org.apache.catalina.core.AprLifecycleListenerinit信息:TheAPRbasedApacheTomcatNativelibrarywhichallowsoptimalperformanceinproductionenvironmentswasnotfoundonthejava.library.path:/xxx/jdk1.5.0_20/jre/lib/i386/client:/xxx/jdk1.5.0_20/jre/lib/i386:/xxx/jdk1.5.0_20/jre/../lib/i3862014-8-302:28:45org.apache.coyote.http11.Http11BaseProtocolinit信息:InitializingCoyoteHTTP/1.1onhttp-88882014-8-302:28:45org.apache.catalina.startup.Catalinaload信息:Initializationprocessedin728ms2014-8-302:28:45org.apache.catalina.core.StandardServicestart信息:StartingserviceCatalina2014-8-302:28:45org.apache.catalina.core.StandardEnginestart信息:StartingServletEngine:ApacheTomcat/5.5.332014-8-302:28:45org.apache.catalina.core.StandardHoststart信息:XMLvalidationdisabledlog4j:WARNNoappenderscouldbefoundforlogger(org.apache.commons.digester.Digester.sax).log4j:WARNPleaseinitializethelog4jsystemproperly.2014-8-302:28:46org.apache.catalina.core.StandardContextstart严重:ErrorlistenerStart2014-8-302:28:46org.apache.catalina.core.StandardContextstart严重:Context[/stastt]startupfailedduetopreviouserrorslog4j:WARNNoappenderscouldbefoundforlogger(org.apache.commons.digester.Digester.sax).log4j:WARNPleaseinitializethelog4jsystemproperly.[DEBUG]2014-08-3002:28:47,989--JspRuntimeContextParentclassloaderis:WebappClassLoaderdelegate:falserepositories:/WEB-INF/classes/---------->ParentClassloader:org.apache.catalina.loader.StandardClassLoader@1f48262[DEBUG]2014-08-3002:28:47,993--JspRuntimeContextCompilationclasspathinitialized:/xxx/stastt3/WebContent/WEB-INF/classes/:/xxx/stastt3/WebContent/WEB-INF/lib/activation-1.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/antlr-2.7.6.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-validator-1.1.4.jar:/xxx/stastt3/WebContent/WEB-INF/lib/dom4j-1.6.jar:/xxx/stastt3/WebContent/WEB-INF/lib/dwr-1.1.4.jar:/xxx/stastt3/WebContent/WEB-INF/lib/ehcache-1.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/hibernate2.jar:/xxx/stastt3/WebContent/WEB-INF/lib/iTextAsian-1.03.jar:/xxx/stastt3/WebContent/WEB-INF/lib/iTextAsianCmaps-1.03.jar:/xxx/stastt3/WebContent/WEB-INF/lib/ibatis-2.3.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/ibatis-dao-2.2.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/itext-1.4.6.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jakarta-oro-2.0.8.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jasperreports-1.2.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jaxen-full-1.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jcommon-1.0.6.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jfreechart-1.0.3.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jstl-1.0.5.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jta.jar:/xxx/stastt3/WebContent/WEB-INF/lib/log4j-1.2.14.jar:/xxx/stastt3/WebContent/WEB-INF/lib/mail-1.4.jar:/xxx/stastt3/WebContent/WEB-INF/lib/mlibwrapper_jai.jar:/xxx/stastt3/WebContent/WEB-INF/lib/mysql-connector-java-5.1.5-bin.jar:/xxx/stastt3/WebContent/WEB-INF/lib/odmg-3.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/poi-3.0-rc4-20070503.jar:/xxx/stastt3/WebContent/WEB-INF/lib/poi-contrib-3.0-rc4-20070503.jar:/xxx/stastt3/WebContent/WEB-INF/lib/poi-scratchpad-3.0-rc4-20070503.jar:/xxx/stastt3/WebContent/WEB-INF/lib/postgresql-8.3-604.jdbc3.jar:/xxx/stastt3/WebContent/WEB-INF/lib/postgresql-8.3-604.jdbc4.jar:/xxx/stastt3/WebContent/WEB-INF/lib/quartz-1.5.2.jar:/xxx/stastt3/WebContent/WEB-INF/lib/saxpath-1.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/spring-full-1.2.8.jar:/xxx/stastt3/WebContent/WEB-INF/lib/sqljdbc.jar:/xxx/stastt3/WebContent/WEB-INF/lib/standard-1.0.5.jar:/xxx/stastt3/WebContent/WEB-INF/lib/struts-1.2.9.jar:/xxx/stastt3/WebContent/WEB-INF/lib/tmsbase.jar:/xxx/stastt3/WebContent/WEB-INF/lib/tmsbase_auth.jar:/xxx/stastt3/WebContent/WEB-INF/lib/velocity-1.4.jar:/xxx/stastt3/WebContent/WEB-INF/lib/velocity-tools-1.3.jar:/xxx/stastt3/WebContent/WEB-INF/classes:/xxx/stastt3/WebContent/WEB-INF/classes/:/xxx/stastt3/WebContent/WEB-INF/lib/activation-1.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/antlr-2.7.6.jar:/xxx/stastt3/WebContent/WEB-INF/lib/cglib-nodep-2.2_beta1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/classes12.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-beanutils-1.7.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-collections-3.2.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-dbcp-1.2.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-digester-1.8.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-fileupload-1.1.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-io-1.3.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-lang-2.3.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-logging-1.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-logging-adapters-1.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-net-1.4.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/commons-validator-1.1.4.jar:/xxx/stastt3/WebContent/WEB-INF/lib/dom4j-1.6.jar:/xxx/stastt3/WebContent/WEB-INF/lib/dwr-1.1.4.jar:/xxx/stastt3/WebContent/WEB-INF/lib/ehcache-1.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/hibernate2.jar:/xxx/stastt3/WebContent/WEB-INF/lib/iTextAsian-1.03.jar:/xxx/stastt3/WebContent/WEB-INF/lib/iTextAsianCmaps-1.03.jar:/xxx/stastt3/WebContent/WEB-INF/lib/ibatis-2.3.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/ibatis-dao-2.2.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/itext-1.4.6.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jakarta-oro-2.0.8.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jasperreports-1.2.1.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jaxen-full-1.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jcommon-1.0.6.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jfreechart-1.0.3.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jstl-1.0.5.jar:/xxx/stastt3/WebContent/WEB-INF/lib/jta.jar:/xxx/stastt3/WebContent/WEB-INF/lib/log4j-1.2.14.jar:/xxx/stastt3/WebContent/WEB-INF/lib/mail-1.4.jar:/xxx/stastt3/WebContent/WEB-INF/lib/mlibwrapper_jai.jar:/xxx/stastt3/WebContent/WEB-INF/lib/mysql-connector-java-5.1.5-bin.jar:/xxx/stastt3/WebContent/WEB-INF/lib/odmg-3.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/poi-3.0-rc4-20070503.jar:/xxx/stastt3/WebContent/WEB-INF/lib/poi-contrib-3.0-rc4-20070503.jar:/xxx/stastt3/WebContent/WEB-INF/lib/poi-scratchpad-3.0-rc4-20070503.jar:/xxx/stastt3/WebContent/WEB-INF/lib/postgresql-8.3-604.jdbc3.jar:/xxx/stastt3/WebContent/WEB-INF/lib/postgresql-8.3-604.jdbc4.jar:/xxx/stastt3/WebContent/WEB-INF/lib/quartz-1.5.2.jar:/xxx/stastt3/WebContent/WEB-INF/lib/saxpath-1.0.jar:/xxx/stastt3/WebContent/WEB-INF/lib/spring-full-1.2.8.jar:/xxx/stastt3/WebContent/WEB-INF/lib/sqljdbc.jar:/xxx/stastt3/WebContent/WEB-INF/lib/standard-1.0.5.jar:/xxx/stastt3/WebContent/WEB-INF/lib/struts-1.2.9.jar:/xxx/stastt3/WebContent/WEB-INF/lib/tmsbase.jar:/xxx/stastt3/WebContent/WEB-INF/lib/tmsbase_auth.jar:/xxx/stastt3/WebContent/WEB-INF/lib/velocity-1.4.jar:/xxx/stastt3/WebContent/WEB-INF/lib/velocity-tools-1.3.jar:/xxx/apache-tomcat-5.5.33/common/i18n/tomcat-i18n-en.jar:/xxx/apache-tomcat-5.5.33/common/i18n/tomcat-i18n-es.jar:/xxx/apache-tomcat-5.5.33/common/i18n/tomcat-i18n-ja.jar:/xxx/apache-tomcat-5.5.33/common/i18n/tomcat-i18n-fr.jar:/xxx/apache-tomcat-5.5.33/common/lib/jsp-api.jar:/xxx/apache-tomcat-5.5.33/common/lib/jasper-compiler-jdt.jar:/xxx/apache-tomcat-5.5.33/common/lib/naming-factory-dbcp.jar:/xxx/apache-tomcat-5.5.33/common/lib/jasper-compiler.jar:/xxx/apache-tomcat-5.5.33/common/lib/jasper-runtime.jar:/xxx/apache-tomcat-5.5.33/common/lib/naming-resources.jar:/xxx/apache-tomcat-5.5.33/common/lib/commons-el.jar:/xxx/apache-tomcat-5.5.33/common/lib/servlet-api.jar:/xxx/apache-tomcat-5.5.33/common/lib/naming-factory.jar:/xxx/apache-tomcat-5.5.33/bin/bootstrap.jar:/xxx/jdk1.5.0_20/jre/lib/ext/localedata.jar:/xxx/jdk1.5.0_20/jre/lib/ext/sunpkcs11.jar:/xxx/jdk1.5.0_20/jre/lib/ext/dnsns.jar:/xxx/jdk1.5.0_20/jre/lib/ext/sunjce_provider.jar[DEBUG]2014-08-3002:28:47,997--JspServletScratchdirfortheJSPengineis:/xxx/stastt3/WebContent/WEB-INF/classes[DEBUG]2014-08-3002:28:47,998--JspServletIMPORTANT:Donotmodifythegeneratedservlets2014-8-302:28:50org.apache.coyote.http11.Http11BaseProtocolstart信息:StartingCoyoteHTTP/1.1onhttp-88882014-8-302:28:50org.apache.jk.common.ChannelSocketinit信息:JK:ajp13listeningon/0.0.0.0:80092014-8-302:28:50org.apache.jk.server.JkMainstart信息:JkrunningID=0time=0/17config=null2014-8-302:28:50org.apache.catalina.storeconfig.StoreLoaderload信息:Findregistryserver-registry.xmlatclasspathresource2014-8-302:28:50org.apache.catalina.startup.Catalinastart信息:Serverstartupin4946ms是两个项目发布后冲突了吗?折腾了半天也没搞定,请高手支招,万分谢谢!
解决方案
解决方案二:
项目的访问路径和xml保持一致。stastt.xml<Contextpath="stastt"docBase=""workDir=""/>
stastt3.xml<Contextpath="stastt3"docBase=""workDir=""/>
解决方案三:
你在${cataline.base}/logs目录下的日志中只发现了这些内容而没有其它像错误的消息?另外它们的web.xml中的名字是一样的么?