File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat configuration" Watch "Tomcat configuration" New topic
Author

Tomcat configuration

SP philip
Greenhorn

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
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
Aldor Bregosson
Greenhorn

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/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=org.apache.log4j.ConsoleAppender
log4j.appender.R.layout=org.apache.log4j.PatternLayout
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
cheers
Aldor
Dave Peterson
Greenhorn

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:
http://mail-archives.apache.org/mod_mbox/tomcat-dev/200807.mbox/%3C48875E63.90503@riotfamily.org%3E

http://tomcat.10.n6.nabble.com/commons-logging-problem-td2154939.html

http://mail-archives.apache.org/mod_mbox/logging-log4j-user/200812.mbox/%3C4958EA85.3000201@qos.ch%3E

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

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: http://aspose.com/file-tools
 
subject: Tomcat configuration