最近发现应用系统运行时,总是有“exception: org.xml.sax.SAXParseException: Content is not allowed in prolog”错误信息,分析错误后,定位components.loggers.xml配置文件有问题,

<entry key="app">
     <bean class="com.cvicse.commons.log.config.Log4jConfig">
      <property name="configFile">
       <value>log4j.properties</value>
      </property>
      <property name="logName">
       <value>app</value>
      </property>
     </bean>
    </entry>

将上面代码中的log4j.properties修改为:log4j.xml文件后,提示

log4j:ERROR The content of element type "log4j:configuration" must match "的错误信息,从百度上搜索可能原因是log4j.xml中文件的位置不对应,发现应用系统中缺少log4j.xml、log4j.properties和log4j.dtd三个配置文件,添加配置文件并部署后,问题解决。