This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat configuration" Watch "Tomcat configuration" New topic

Tomcat configuration

SP philip

Joined: May 08, 2008
Posts: 2
Can anybody please help??When I tried to run by project from Tomcat , I am getting the following error.

SEVERE: Error reading tld listeners java.lang.NullPointerException
at org.apache.log4j.Category.isEnabledFor(
at org.apache.commons.logging.impl.Log4JLogger.isTraceEnabled(
at org.apache.catalina.startup.TldConfig.tldScanResourcePaths(
at org.apache.catalina.startup.TldConfig.execute(
at org.apache.catalina.core.StandardContext.processTlds(
at org.apache.catalina.core.StandardContext.start(
at org.apache.catalina.core.ContainerBase.addChildInternal(
at org.apache.catalina.core.ContainerBase.addChild(
at org.apache.catalina.core.StandardHost.addChild(
at org.apache.catalina.startup.HostConfig.deployDescriptor(
at org.apache.catalina.startup.HostConfig.deployDescriptors(
at org.apache.catalina.startup.HostConfig.deployApps(
at org.apache.catalina.startup.HostConfig.check(
at org.apache.catalina.startup.HostConfig.lifecycleEvent(
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
at org.apache.catalina.core.ContainerBase.backgroundProcess(
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(
at org.apache.catalina.core.ContainerBase$
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.
Jun 26, 2008 2:08:06 PM org.apache.commons.modeler.Registry registerComponent
SEVERE: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/test,J2EEApplication=none,J2EEServer=none
Aldor Bregosson

Joined: Jan 04, 2008
Posts: 3
As far as I can see, the application you deployed tries to log something through Log4J. Tomcat tries to register a Logger and an "Appender" but can't find one. Hence the NullPointerException.

To have Tomcat use Log4J universally, place both libraries log4j.jar and the Jakarta commons-logging.jar into the $TOMCAT_HOME/common/lib directory. Create your log4j properties file as $TOMCAT_HOME/common/classes/ and configure the root logger. Here is the basic I used for this myself:

log4j.rootLogger=info, R
log4j.appender.R.layout.ConversionPattern=%-5p %-30.30c{1} %x - %m%n

Instead of "info" you can rise the "granularity" of the output by mentioning "warn" or even "debug" in the first line. But be warned: the latter will often produce HUGE amounts of logging output. All "Console" output (also the System.out.println you may have in your application) goes to $TOMCAT_HOME/logs/catalina.out.

Don't forget to restart Tomcat after making these changes.

Let me know if that helps
Dave Peterson

Joined: Jan 24, 2009
Posts: 4
This is likely due to a change in many of the application servers (including Tomcat) where the app server nulls out static final references. This was done to prevent permgen memory leakage causing issues when applications are deployed repeatedly. Some references:

Personally I suggest that you try to avoid using static Logger references.
shashikant mourya

Joined: Jan 15, 2010
Posts: 6
This might be late, but it may be useful for future solution-seekers. There is no issue with your project or with your tomcat configuration. Just check your commons logging jar version and replace it with an older version. I resolved this issue by replacing my commons-logging jar in WEB-INF/lib folder from version 1.1.1 to 1.0.4. It has been discussed here- Apache BugZila
Hope It Helps
I agree. Here's the link:
subject: Tomcat configuration