严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stuService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/jfree/data/category/CategoryDataset
Caused by: java.lang.NoClassDefFoundError: org/jfree/data/category/CategoryDataset这是错误提示, 具体问题加我qq:1664739517

解决方案 »

  1.   

    初始化错误,少包,贴jar包结构和xml
      

  2.   

    <?xml version="1.0" encoding="UTF-8"?>
    <beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
    <property name="url" value="jdbc:mysql://localhost:3306/stud"></property>
    <property name="username" value="root"></property>
        <property name="password" value="sa"></property>
        <property name="maxActive" value="200"></property>
        <property name="maxIdle" value="30"></property>
        <property name="maxWait" value="500"></property>
        <property name="defaultAutoCommit" value="true"></property>
    </bean>



    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource"></property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
    <prop key="hibernate.show_sql">true</prop>
    </props>
    </property>
    <property name="mappingResources">
    <list>
    <value>com/test/bean/User.hbm.xml</value>
    </list>
    </property>
    </bean>


    <bean id="transactionManager"  class="org.springframework.orm.hibernate3.HibernateTransactionManager"> 
                <property name="sessionFactory" ref="sessionFactory"/> 
            </bean>


    <bean id="dao" class="com.test.dao.daoimpl.Daoimpl" scope="singleton">
    <property name="sessionFactory" ref="sessionFactory"></property>
    </bean>

    <bean id="stuService" class="com.test.service.serviceimpl.ServiceImpl" scope="singleton">
    <property name="dao" ref="dao"></property>
    </bean>


    <bean id="registerAction" class="com.test.action.RegisterAction" scope="prototype">
    <property name="service" ref="stuService"></property>
    </bean>

    <bean id="listUserAction" class="com.test.action.ListAllUsersAction" scope="prototype">
    <property name="service" ref="stuService"></property>
    </bean>

    <bean id="deleteUserAction" class="com.test.action.DeleteUserAction" scope="prototype">
    <property name="service" ref="stuService"></property>
    </bean>

    <bean id="updatePUserAction" class="com.test.action.UpdatePUserAction" scope="prototype">
    <property name="service" ref="stuService"></property>
    </bean>

    <bean id="updateUserAction" class="com.test.action.UpdateUserAction" scope="prototype">
    <property name="service" ref="stuService"></property>
    </bean>


    <bean id="loginAction" class="com.test.action.LoginUserAction" scope="prototype">
    <property name="service" ref="stuService"></property>
    </bean>


    <bean id="downloadAction" class="com.test.action.UserInfoExcelAction" scope="prototype">
    <property name="service" ref="stuService"></property>
    </bean>

    <bean id="userChartAction" class="com.test.action.UserChartAction">
    <property name="service" ref="stuService"></property>
    </bean>

    <bean id="listByPageAction" class="com.test.action.UserList" scope="prototype">
    <property name="service" ref="stuService"></property>
    </bean>
    </beans>
    antlr-2.7.2.jar
    antlr-2.7.6rc1.jar
    aopalliance.jar
    asm-attrs.jar
    asm-commons-2.2.3.jar
    asm-util-2.2.3.jar
    asm.jar
    aspectjrt.jar
    aspectjweaver.jar
    c3p0-0.9.0.jar
    c3p0-0.9.1.2.jar
    cglib-2.1.3.jar
    cglib-nodep-2.1_3.jar
    commons-attributes-api.jar
    commons-attributes-compiler.jar
    commons-codec.jar
    commons-collections-2.1.1.jar
    commons-dbcp.jar
    commons-fileupload.jar
    commons-httpclient.jar
    commons-io.jar
    commons-lang.jar
    commons-logging-1.0.4.jar
    commons=logging-api-1.1.jar
    commons-logging.jar
    commons=pool.jar
    concurrent-1.3.2.jar
    connector.jar
    cos.jar
    dom4j-1.6.1.jar
    ehcache-1.1.jar
    freeer.jar
    hibernate3.jar
    itext-1.3.jar
    jaas.jar
    jacc-1_0-fr.jar
    jakarta-oro-2.0.8.jar
    jasperreports-1.3.4.jar
    jaxen-1.1-beta-7.jar
    jboss-cache.jar
    jboss-common.jar
    jboss=jmx.jar
    jboss-system.jar
    jdbc2_0-stdext.jar
    jgroups-2.2.8.jar
    jotm.jar
    jta.jar
    jxl.jar
    log4j-1.2.11.jar
    log4j-1.2.14.jar
    mysql-connector=java-3.1.10-bin.jar
    ognl-2.6.11.jar
    oscache-2.1.jar
    persistence.jar
    poi-2.5.1.jar
    portlet-api.jar
    proxool-0.8.3.jar
    spring-agent.jar
    spring-aop.jar
    spring-beans.jar
    spring-context.jar
    spring-core.jar
    spring-dao.jar
    spring-hibernate3.jar
    spring-ibatis.jar
    spring-jca.jar
    spring-jdbc.jar
    spring-jdo.jar
    spring-jms.jar
    spring-jpa.jar
    spring-portlet.jar
    spring-struts.jar
    spring-tomcat-weaver.jar
    spring-toplink.jar
    spring-web.jar
    spring-webmvc.jar
    spring-struts.jar
    struts2-core-2.0.11.2.jar
    struts2-spring-plugin-2.0.11.2.jar
    swarmcache-1.0rc2.jar
    velocity-1.5.jar
    velocity-tools=view-1.3.jar
    xapool.jar
    xerces-2.6.2.jar
    xml-apis.jar
    xwork-2.0.5.jar
      

  3.   

    listener配置没有?
    最好把listener配置在web.xml的最上面!
      

  4.   

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.FilterDispatcher
    </filter-class>
    </filter> <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping> <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list> <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>

    <!--<servlet>
    <servlet-name>DeleteFileServlet</servlet-name>
    <servlet-class>com.test.servlet.DeleteFileServlet</servlet-class>
    <load-on-startup>8</load-on-startup>
    </servlet>
    --></web-app>
      

  5.   

    struts2-jfreechart-plugin-2.1.8.1.jar 
    jcommon-1.0.16.jar
    jfreechart-1.0.13.jar
      

  6.   

    jfree包,我认为没有必要!我的项目中就没有!
    <listener>   
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>   
        </listener>  
    这个最好是放在最上面试一下!
      

  7.   

    我仔细看了一下你的jar包,有N多个完全没有必要!你都把它引入进来了,运行起来不慢吗?
    还有,你的项目,居然没有出现jar包冲突的吗?
      

  8.   

    如果配置都没有问题的话,那就考虑解决一下,可能是有重复的JAR导致的冲突。
      

  9.   

    你可能把不要的包也导进去了或是哪个必需的包没导入,以下是必需包: 
    Spring包(9个): 
    commons-dbcp.jar、commons-pool.jar、spring.jar、spring-beans.jar、 
    spring-context.jar、spring-core.jar、spring-dao.jar、 
    spring-hibernate3.jar、spring-web.jar。 struts2.0包(6个):commons-logging-api-1.1.jar、freeer-2.3.8.jar 
    ognl-2.6.11.jar、struts2-core-2.0.8.jar、 
    struts2-spring-plugin-2.0.11.2.jar、xwork-2.0.3.jar hibernate包:myeclipse工具自动添加生成导入。 
    还有就是数据库驱动包。
      

  10.   

    org/jfree/data/category/CategoryDataset是什么啊
      

  11.   

    严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stuService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/jfree/data/category/CategoryDataset
    Caused by: java.lang.NoClassDefFoundError: org/jfree/data/category/CategoryDataset一直是这个错误, 再没有人帮我解决,我就疯了.