java.lang.ClassNotFoundException:org.apache.log4j.PatterLayout

时间:2022-07-25 21:52:58

After fixing by old issue i have gave a fix what specified in this link

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

How to configure log4j with a properties file but now i am facing a new issue i.e

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

I get the following Error Messge:

我得到以下错误消息:

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)

Can any one help me out off this please .....

请任何人帮我解决这个问题.....

1 个解决方案

#1


3  

You spelled PatternLayout wrong in your log4j.properties. You are missing the "N"!

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

#1


3  

You spelled PatternLayout wrong in your log4j.properties. You are missing the "N"!

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