• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Tomcat configuration

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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(Category.java:749)
at org.apache.commons.logging.impl.Log4JLogger.isTraceEnabled(Log4JLogger.java:327)
at org.apache.catalina.startup.TldConfig.tldScanResourcePaths(TldConfig.java:581)
at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:282)
at org.apache.catalina.core.StandardContext.processTlds(StandardContext.java:4302)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4139)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1190)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:292)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1305)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1569)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1578)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1558)
at java.lang.Thread.run(Thread.java:613)
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/log4j.properties and configure the root logger. Here is the basic log4j.properties 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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Bookmark Topic Watch Topic
  • New Topic