Java 没有internet时Tomcat中Spring应用程序的部署问题

Java 没有internet时Tomcat中Spring应用程序的部署问题,java,spring,tomcat,logging,log4j,Java,Spring,Tomcat,Logging,Log4j,我希望有人能在这里帮助我,因为我真的不知道为什么会发生这种情况。 基本上我有一个Spring应用程序,它工作得很好,但是当我没有互联网连接时,它在tomcat下部署失败 有时它就止于此: log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. l

我希望有人能在这里帮助我,因为我真的不知道为什么会发生这种情况。 基本上我有一个Spring应用程序,它工作得很好,但是当我没有互联网连接时,它在tomcat下部署失败

有时它就止于此:

log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Jul 26, 2014 1:50:57 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Jul 26, 2014 1:50:57 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/myapp] startup failed due to previous errors
Jul 26, 2014 1:50:57 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /bla/bla/tomcat-7.0.54/webapps/myapp.war has finished in 1,113 ms
有时它经过这里,停在这里:

log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Jul 26, 2014 1:50:57 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Jul 26, 2014 1:50:57 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/myapp] startup failed due to previous errors
Jul 26, 2014 1:50:57 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /bla/bla/tomcat-7.0.54/webapps/myapp.war has finished in 1,113 ms
请注意,我的日志记录没有问题,或者Spring没有问题。该应用程序在部署(我有互联网连接)时运行良好,并以我想要的方式记录所有内容,这意味着我的log4j.properties被找到并正确读取

我真的很困惑,希望有人能找到答案

提前谢谢 M

嗯, 我想我知道问题是什么。 打开日志调试*后,请查看它在以下位置失败:

    NFO: Initializing Spring root WebApplicationContext
Jul 31, 2014 3:05:20 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [dal/dal.xml]
Offending resource: class path resource [SpringContext.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 123 in XML document from class path resource [dal/dal.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 123; columnNumber: 14; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aop:config'.
    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:218)
...
这表明我的数据访问层初始化失败,在查看之后,我意识到,当然,我在XML文件上有以下内容,需要读取这些文件以初始化应用程序DAO等,这需要互联网

    <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                    http://www.springframework.org/schema/tx 
                    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
                    http://www.springframework.org/schema/aop 
                    http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
                    http://www.springframework.org/schema/context
                    http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <!--


»严重:错误listenerStart«这表示在引导SPRING容器时出现重大故障。我建议如下:1)关闭tomcat 2)清除tomcat日志文件夹3)重新启动tomcat 4)检查
localhost.log
(或使用文件名中的当前时间戳)我打赌会引发异常,这告诉我们一个小秘密,为什么这不起作用。请打开调试或跟踪并检查日志。不幸的是,清除日志,重新启动等没有向我显示任何新错误。问题是当我上网时,一切都很好。我的假设是,幕后正在发生一些需要互联网的事情,我不知道那是什么。如何打开调试或跟踪?