Can't get redeploying in Tomcat to work?

If I try to redeploy by pressing Ctrl-F9, I get the following exception....:

Connected to server
Nov 1, 2006 2:47:04 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context []
Nov 1, 2006 2:47:05 PM org.apache.catalina.core.StandardContext processTlds
SEVERE: Error reading tld listeners java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.log4j.helpers.PatternConverter.spacePad(PatternConverter.java:106)
at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:79)
at org.apache.log4j.PatternLayout.format(PatternLayout.java:503)
at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:301)
at org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.java:236)
at org.apache.log4j.WriterAppender.append(WriterAppender.java:159)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65) at
org.apache.log4j.Category.callAppenders(Category.java:203) at
org.apache.log4j.Category.forcedLog(Category.java:388) at org.apache.log4j.Category.log(Category.java:853)
at org.apache.commons.logging.impl.Log4JLogger.debug(Log4JLogger.java:171)
at org.apache.catalina.startup.TldConfig.tldScanResourcePaths(TldConfig.java:575)
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:595)


What am I missing?


Regards,

BTJ

4 comments

Hello Bjørn,

Looks like a log4j problem. Perhaps your log4j configuration file is corrupted.

If I try to redeploy by pressing Ctrl-F9, I get the following
exception....:

Connected to server
Nov 1, 2006 2:47:04 PM org.apache.catalina.startup.HostConfig
checkResources
INFO: Undeploying context []
Nov 1, 2006 2:47:05 PM org.apache.catalina.core.StandardContext
processTlds
SEVERE: Error reading tld listeners java.lang.NullPointerException
java.lang.NullPointerException
at
org.apache.log4j.helpers.PatternConverter.spacePad(PatternConverter.ja
va:106)
at
org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java
:79)
at org.apache.log4j.PatternLayout.format(PatternLayout.java:503)
at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:301)
at
org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.jav
a:236)
at org.apache.log4j.WriterAppender.append(WriterAppender.java:159)
at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(
AppenderAttachableImpl.java:65) at
org.apache.log4j.Category.callAppenders(Category.java:203) at
org.apache.log4j.Category.forcedLog(Category.java:388) at
org.apache.log4j.Category.log(Category.java:853)
at
org.apache.commons.logging.impl.Log4JLogger.debug(Log4JLogger.java:171
)
at
org.apache.catalina.startup.TldConfig.tldScanResourcePaths(TldConfig.j
ava:575)
at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:282)
at
org.apache.catalina.core.StandardContext.processTlds(StandardContext.j
ava:4302)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:41
39)
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.jav
a:608)
at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.ja
va: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(Lifecycle
Support.java:119)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase
.java:1305)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.pr
ocessChildren(ContainerBase.java:1569)
at

org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.pr
ocessChildren(ContainerBase.java:1578)

at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.ru
n(ContainerBase.java:1558) at

java.lang.Thread.run(Thread.java:595)

What am I missing?

Regards,

BTJ



0

Not sure what that would be... My logfiles are created and filled with the correct log....

And my log4j.xml resides in WEB-INF/classes directory and looks like this..:

]]>
<param name="ConversionPattern" value="%d %-5p %-15c : %m%n"/> </layout> </appender> <appender name="fileLog" > <param name="File" value="/bjorntj/logs/tcm/assit.log"/> <param name="MaxFileSize" value="10MB"/> <param name="MaxBackupIndex" value="2"/> <layout > <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss,SSS} %-5p %-15c - %m%n"/>
]]>
<param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss,SSS} %-5p %-15c - %m%n"/> </layout> </appender> <appender name="springLog" > <param name="File" value="/bjorntj/logs/tcm/spring.log"/> <param name="MaxFileSize" value="10MB"/> <param name="MaxBackupIndex" value="2"/> <layout > <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss,SSS} %-5p %-15c - %m%n"/>
]]>
<param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss,SSS} %-5p %-15c - %m%n"/> </layout> </appender> <appender name="sqlLog" > <param name="File" value="/bjorntj/logs/tcm/sql.log"/> <param name="MaxFileSize" value="10MB"/> <param name="MaxBackupIndex" value="2"/> <layout > <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss,SSS} %-5p %-15c - %m%n"/>
]]>
<param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss,SSS} %-5p %-15c - %m%n"/> </layout> </appender> <appender name="hibernateLog" > <param name="File" value="/bjorntj/logs/tcm/hibernate.log"/> <param name="MaxFileSize" value="10MB"/> <param name="MaxBackupIndex" value="2"/> <layout > <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss,SSS} %-5p %-15c - %m%n"/>
]]>
<param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss,SSS} %-5p %-15c - %m%n"/>
]]>
<param name="ConversionPattern"
value="[%d]%n%n%-5p%n%n%c%n%n%m%n%n"/>
]]>



BTJ

0

I also tried removing my log4j.xml file and I still get a NPE but not the same one, but almost..:


SEVERE: Error reading tld listeners java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.log4j.Category.isEnabledFor(Category.java:746)
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:595)
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.



BTJ

0

Hello Bjørn,

Looks like the problem is not with logging of your application but with logging
of Tomcat itself.

I also tried removing my log4j.xml file and I still get a NPE but not
the same one, but almost..:

SEVERE: Error reading tld listeners java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.log4j.Category.isEnabledFor(Category.java:746)
at
org.apache.commons.logging.impl.Log4JLogger.isTraceEnabled(Log4JLogger
.java:327)
at
org.apache.catalina.startup.TldConfig.tldScanResourcePaths(TldConfig.j
ava:581)
at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:282)
at
org.apache.catalina.core.StandardContext.processTlds(StandardContext.j
ava:4302)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:41
39)
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.jav
a:608)
at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.ja
va: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(Lifecycle
Support.java:119)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase
.java:1305)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.pr
ocessChildren(ContainerBase.java:1569)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.pr
ocessChildren(ContainerBase.java:1578)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.ru
n(ContainerBase.java:1558)
at java.lang.Thread.run(Thread.java:595)
log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.

BTJ



0

Please sign in to leave a comment.