新建一个项目,加上spring 框加,配置服务器,启动,,,
都会报上面的错误,,,
真是让我着急呀,,
请大家帮我看看呀,,

解决方案 »

  1.   

    applicationContext.xml<?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">
    <property name="driverClassName"
    value="com.mysql.jdbc.Driver">
    </property>
    <property name="url"
    value="jdbc:mysql://localhost:3306/mobileservicesystem">
    </property>
    <property name="username" value="root"></property>
    <property name="password" value="root"></property>
    </bean>


    </beans>
      

  2.   

    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" 
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      
      <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
      </context-param>
      
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
      
      <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>
      </filter>
      
    </web-app>
      

  3.   

    dataSource,初始化失败;二种可能:
    一种配置文件写错,概率10%
    一种是jar包冲突,概率50%以上问题应该出在这句上:Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool at java.lang.Class.getDeclaredConstructors0(Native Method) 
    缺少commons-pool-版本.jar的jar的包,找地方下一个就没事了~
      

  4.   

    java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 
    也就是说 org/apache/commons/pool/impl/GenericObjectPool 不能发现你看工程中有没有commons-pool-*.jar这个包
    应该没 就添加一个这样的包
      

  5.   

    问题解决了,谢谢各位了呀!我把commons-pool-1.4.jar包加入以后又报了另一个错误,后来网上查了查,,发现在Spring + Hibernate 时会发生包冲突的问题,,
    (我觉得这合用MyEclipse有很大关系,以后要学着深入了解,手工导入了,这样可能会好一些)小弟在网上找了一些关系包冲突,还有SSH整合易出现错误的文章,希望对大家也有所帮助。。
    http://blog.csdn.net/Ghosthuo