开发者社区> 问答> 正文

Tomcat启动报错,求指点,百度半天无果?报错

信息: validateJarFile(D:\Program\apache-tomcat-7.0.55\webapps\lms\WEB-INF\lib\j2ee.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
2014-9-17 13:58:58 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: /oscache is already defined
dFrame: dFrame's initializing...log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [sun.misc.Launcher$AppClassLoader@f6a746] whereas object of type 
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader
  context: /lms
  delegate: false
  repositories:
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@1f4cbee
].
log4j:ERROR Could not instantiate appender named "CONSOLE".
log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender
	at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:165)
	at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
	at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
	at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
	at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:335)
	at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:781)
	at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666)
	at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
	at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602)
	at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:697)
	at dframe.core.CoreProcessImpl.init(CoreProcessImpl.java:90)
	at dframe.core.DFrameServlet.init(DFrameServlet.java:62)
	at javax.servlet.GenericServlet.init(GenericServlet.java:158)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5229)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5516)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)



展开
收起
爱吃鱼的程序员 2020-06-14 21:42:04 973 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    多个log4j.jar被不同classloader加载。
    你的org.apache.log4j.<spanstyle="font-family:Consolas,'BitstreamVeraSansMono','CourierNew',Courier,monospace;font-size:14px;line-height:15.399999618530273px;background-color:#FFFFFF;">Appender是sun.misc.Launcher$AppClassLoader@f6a746这个类加载的,<spanstyle="font-family:Consolas,'BitstreamVeraSansMono','CourierNew',Courier,monospace;font-size:14px;line-height:15.399999618530273px;background-color:#FFFFFF;">org.apache.log4j.ConsoleAppender是这个类org.apache.catalina.loader.StandardClassLoader@1f4cbee,jvm规范规定不是同一个classload加载的类是不同的,肯定会cast不了,你可以看下你的工程,是不是有多个log4j.jar,或者你的tomcat加载了log4j好的我看看

    2020-06-14 21:42:20
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Apache Tomcat 的云原生演进 立即下载
百度研发工具集的应用实践 立即下载
百度研发工具集的应用实践——打造持续交付路上的“三堵墙” 立即下载