-1

通过旧问题修复后,我已经修复了此链接中指定的内容

如何使用属性文件配置 log4j但现在我面临一个新问题,即

我收到以下错误消息:

log4j:ERROR Could not instantiate class [org.apache.log4j.PatterLayout].

java.lang.ClassNotFoundException: org.apache.log4j.PatterLayout
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.log4j.helpers.Loader.loadClass(Loader.java:169)
    at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:317)
    at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.java:120)
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:641)
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
    at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441)
    at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:336)
    at com.akak.book.shop.listener.JlcindiaContextListener.contextInitialized(JlcindiaContextListener.java:33)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    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:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

任何人都可以帮我解决这个问题......

4

1 回答 1

3

PatternLayout您在 log4j.properties 中拼写错误。你错过了“N”!

于 2013-03-13T15:19:14.663 回答