Saturday, February 26, 2011

log4j:ERROR Could not parse url [file:/usr/share/tomcat6/lib/log4j.xml]

I encountered this problem while working with an LMS known as OLAT

when I do a restart of tomcat server as /etc/init.d/tomcat6 restart

then in catalina.out I see following
log4j:ERROR Could not parse url [file:/usr/share/tomcat6/lib/log4j.xml].
org.xml.sax.SAXParseException: The markup in the document following
the root element must be well-formed.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
at 
org.apache.log4j.xml.DOMConfigurator$2.parse(DOMConfigurator.java:612)
at 
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:711)
at 
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:618)
at 
org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:743)
at 
org.springframework.util.Log4jConfigurer.initLogging(Log4jConfigurer.java:69)
at 
org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:151)
at 
org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at 
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
at 
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

As a remedy to this problem the only work around I observed working is
I delete /usr/share/tomcat6/lib/log4j.xml
and create it again as mentioned here
https://lists.uzh.ch/lists.olat.org/sympa/arc/olat-users/2010-11/msg00054.html
and then restart tomcat6 then the above error goes and I am able to
get olat back.

No comments: