检查你的applicationContext.xml这个配置文件,貌似SessionFactory这个bean创建出错。

解决方案 »

  1.   

    下载一个最新的commons-beanutils包替换到lib目录下试试。
      

  2.   

    我怀疑是user关键字的问题,你这样把User.hbm.xml改一下试试
     <class name="com.ly.entity.User" table="[user]" >
      

  3.   

    吧表名字改了也不可以 帮我看看 applicationcContext.xml 这里 配置sessionFactory时候出错没有 <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/ssh"></property>
    <property name="username" value="root"></property>
    <property name="password" value=""></property>
    </bean>
    <bean id="sf"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource">
    <ref bean="DataSource" />
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">
    org.hibernate.dialect.MySQLDialect
    </prop>
    </props>
    </property>
    <property name="mappingResources">
    <list>
    <value>com/ly/entity/User.hbm.xml</value>
        </list>
    </property>
    </bean>
      

  4.   

    你是用myeclipse开发?你所用的jar包是myeclipse生成的吗
    替换到myeclipse生成的jar包,用你所下载的spring的lib目录下的jar包
    其中包括commons-beanutils包
      

  5.   

    还有可能是在程序的classpath下,引入了重复的包,比如commons-beanutils-x.jar和commons-beanutils-y.jar
      

  6.   

    是过得 还是不可以 
    MyEclipse 6.0 配置 太埃求了
    你们是用的哪个版本啊  
      

  7.   

     org.springframework.web.struts.ContextLoaderPlugIn.init
    Context initialization failed 
    初始化失败   
      看看你的applicationContext.xml里面sessionFactory 在看看你的dao注入的sessionFactory
      看看你的Hibernate.cfg.xml里面都写什么org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: