2 fnzf14428547 fnzf14428547 于 2016.05.09 14:03 提问

tomcat启动出错,找不到解决办法,求大神指点
 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)
程序正执行XxtContextListen.contextInitialized()..
log4j已经配置...
log4j:WARN Continuable parsing error 2 and column 69
log4j:WARN Document root element "log4j:configuration", must match DOCTYPE root "null".
log4j:WARN Continuable parsing error 2 and column 69
log4j:WARN Document is invalid: no grammar found.
09:14:35,062 INFO  [qtone.xxt.teacher.util.LoggerUtil] (qtone.xxt.teacher.util.LoggerUtil:23) - 主线系统初始化,设置WEB应用路径: C:\Users\Administrator\git\teacherwebapp\WebContent\
09:14:35,067 INFO  [qtone.xxt.teacher.util.LoggerUtil] (qtone.xxt.teacher.util.LoggerUtil:23) - 已经配置业务逻辑模块....
2016-5-9 9:14:35 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class qtone.xxt.teacher.base.init.XxtContextListen
java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)

web.xml配置

 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>WEB-INF/SpringContext.xml,WEB-INF/SpringRabbitMQ.xml</param-value>
<!--    <param-value>WEB-INF/SpringContext.xml</param-value>-->
  </context-param>
    <context-param>
    <param-name>purviewclass</param-name>
    <param-value>qtone.xxt.teacher.base.init.PurviewImp</param-value>
  </context-param>
  <context-param>
    <param-name>log4j</param-name>
    <param-value>WEB-INF/log4j.xml</param-value>
  </context-param>
  <context-param>
    <param-name>springUtilHandlerClass</param-name>
    <param-value>qtone.xxt.teacher.base.init.SpringContextImp</param-value>
  </context-param>


   <session-config>
       <session-timeout>120</session-timeout>
   </session-config>

    <!-- spring的编码设置过滤器 -->
    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>
            org.springframework.web.filter.CharacterEncodingFilter
        </filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>utf-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>*.do</url-pattern>
    </filter-mapping>

    <filter>  
        <filter-name>IllegalCharacterFilter</filter-name>  
        <filter-class>qtone.xxt.teacher.base.filters.IllegalCharacterFilter</filter-class>  
    </filter>  
    <filter-mapping>  
        <filter-name>IllegalCharacterFilter</filter-name>  
        <url-pattern>*.do</url-pattern>  
    </filter-mapping> 

  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
  </listener>

  <!-- 校讯通监听 -->
  <listener>
    <listener-class>qtone.xxt.teacher.base.init.XxtContextListen</listener-class>
  </listener>

  <filter>
    <filter-name>urlfilter</filter-name>
    <filter-class>qtone.xxt.teacher.base.ActionFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>urlfilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <servlet>
    <servlet-name>dispatcherServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>dispatcherServlet</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>

  <welcome-file-list>
    <welcome-file>index.htm</welcome-file>
  </welcome-file-list>

</web-app>

6个回答

qq_17555933
qq_17555933   2016.05.09 14:20

listener ,你检查一下bean文件,或者web.xml文件;或者看你最近修改过得xml文件

fnzf14428547
fnzf14428547 没动过啊。直接从git上拉下来就搭建不起来
一年多之前 回复
qq_17555933
qq_17555933   2016.05.09 14:28

你使用maven 更新一下试试看,快捷键ctrl+F5

qq_17555933
qq_17555933 回复fnzf14428547: log4j已经配置... log4j:WARN Continuable parsing error 2 and column 69 log4j:WARN Document root element "log4j:configuration", must match DOCTYPE root "null". log4j:WARN Continuable parsing error 2 and column 69 log4j:WARN Document is invalid: no grammar found. 这个配置文件看看,检查一下是不是这里的问题
一年多之前 回复
fnzf14428547
fnzf14428547 项目不是maven的
一年多之前 回复
fk002008
fk002008   2016.05.09 14:28

java.lang.NoClassDefFoundError
类找不到

listener instance of class org.springframework.web.context.ContextLoaderListener

检查下你的web.xml文件中的配置是否正确

fnzf14428547
fnzf14428547 回复lambda-fk: 好着呢,而且这些基本没什么错误,都是从git上拉下来的项目
一年多之前 回复
fk002008
fk002008 这样吧,你把这个ctrl按住然后用鼠标点击写在web.xml里面的类,有连接的是OK 的,没有就是缺失的。如果都有再看看 applicationcontext.xml.
一年多之前 回复
fnzf14428547
fnzf14428547 我把web.xml贴上面了,我没发现那里错了啊
一年多之前 回复
linxingall
linxingall   2016.05.09 15:45

spring-beans.jar这个jar加了吗

fnzf14428547
fnzf14428547 加了后还是这个错误
一年多之前 回复
fnzf14428547
fnzf14428547 好像没这个jar
一年多之前 回复
Royal_lr
Royal_lr   Ds   Rxr 2016.05.09 16:27

spring会依赖很多jar包,,jar包配齐就行了

fnzf14428547
fnzf14428547 回复Royal_lr: 以前没有还是可以运行的啊,我重装的系统,然后搭建出的问题,别人都好着啊
一年多之前 回复
Royal_lr
Royal_lr 回复fnzf14428547: spring-beans.jar这个基本的jar都没有,,你还说是齐着的
一年多之前 回复
fnzf14428547
fnzf14428547 本来就齐着啊,我一直不知道是哪里问题,我觉得是不是系统问题
一年多之前 回复
fnzf14428547
fnzf14428547 本来就齐着啊,我一直不知道是哪里问题,我觉得是不是系统问题
一年多之前 回复
CSDNXIAOD
CSDNXIAOD   2016.05.09 18:52

tomcat启动时,一闪,出错的解决办法
----------------------biu~biu~biu~~~在下问答机器人小D,这是我依靠自己的聪明才智给出的答案,如果不正确,你来咬我啊!

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!