使用tomcat+jdon的问题

07-10-13 franzcai

在学习testWeb过程中,按照readm_cn.txt的做法配置,在

stdout_20071013.log文件中出现以下信息

log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.Embedded).

log4j:WARN Please initialize the log4j system properly.

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

Caused by: java.lang.NullPointerException

at org.apache.catalina.startup.Catalina.await(Catalina.java:616)

at org.apache.catalina.startup.Catalina.start(Catalina.java:576)

... 6 more

我使用tomcat5,但logs目录下没有tomcat.log文件

,这个问题论坛上已经有人问,但没有确实解决方法.是不是我复制的log4j.jar文件有问题,究竟应该使用哪个?

附:

#

# Configures Log4j as the Tomcat system logger

#

#

# Configure the logger to output info level messages into a rolling log file.

#

#log4j.rootLogger=DEBUG, R

#

# To continue using the "catalina.out" file (which grows forever),

# comment out the above line and uncomment the next.

#

#log4j.rootLogger=INFO, A1

#

# Configuration for standard output ("catalina.out").

#

log4j.appender.A1=org.apache.log4j.ConsoleAppender

log4j.appender.A1.layout=org.apache.log4j.PatternLayout

#

# Print the date in ISO 8601 format

#

log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

#

# Configuration for a rolling log file ("tomcat.log").

#

log4j.appender.R=org.apache.log4j.DailyRollingFileAppender

log4j.appender.R.DatePattern='.'yyyy-MM-dd

#

# Edit the next line to point to your logs directory.

# The last part of the name is the log file name.

#

log4j.appender.R.File=D:/tomcat/logs/tomcat.log

log4j.appender.R.layout=org.apache.log4j.PatternLayout

#

# Print the date in ISO 8601 format

#

log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

#

# Application logging options

#

log4j.logger.com.jdon=DEBUG

#log4j.logger.org.apache=DEBUG

#log4j.logger.org.apache=INFO

#log4j.logger.org.apache.struts=DEBUG

#log4j.logger.org.apache.struts=INFO

banq
2007-10-13 21:17

log4j确实是一个扰人的问题。

将log4j.properties放在WEB-INF/classess目录下就可以了,我已经测试通过的,不知现在Tomcat6如何。

liuweicss
2007-10-17 09:58

楼主你好,我现在也遇到了同样的问题:

log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.Embedded).

log4j:WARN Please initialize the log4j system properly.

请问你的问题解决了吗?我换了一个workspace,并且新建了一个web工程,结果在启动tomcat5.5的时候还是出现上面的log4j警告信息,实在是崩溃了,急............

help!!!-------------------------------

我的 Q Q :57855150,请帮帮兄弟吧... :)

[该贴被liuweicss于2007-10-17 09:59修改过]

[该贴被liuweicss于2007-10-17 10:00修改过]

[该贴被liuweicss于2007-10-17 10:00修改过]