我以前试过缺某个jar包,后来加上,可是还是不管用,然后我就把tomcat给清了,然后就好了

解决方案 »

  1.   

    sessionFactory 无法创建,spring配置文件有问题 
      

  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"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.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/et?useUnicode=true&amp;characterEncoding=UTF-8">
    </property>
    <property name="username" value="root"></property>
    <property name="password" value="yucs12345"></property>
    </bean>
    <bean id="sessionFactory"
    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/et/pojo/User.hbm.xml</value>
    <value>com/et/pojo/Supplier.hbm.xml</value>
    <value>com/et/pojo/Bill.hbm.xml</value></list>
    </property>
    </bean>
    <bean id="USERDAO" class="com.et.dao.impl.UserDaoImpl">
    <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
    <bean id="userService" class="com.et.service.impl.UserServiceImpl">
    <property name="userDao" ref="USERDAO"></property>
    </bean>

    <bean id="SUPDAO" class="com.et.dao.impl.SupDaoImpl">
    <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
    <bean id="supService" class="com.et.service.impl.SupServiceImpl">
    <property name="supDao" ref="SUPDAO"></property>
    </bean>

    <bean id="BILLDAO" class="com.et.dao.impl.BillDaoImpl">
    <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
    <bean id="billService" class="com.et.service.impl.BillServiceImpl">
    <property name="billDao" ref="BILLDAO"></property>
    </bean>
    </beans>
      

  3.   

    你搭建hibernate的时候   可能有问题  报的sessionFactory的错误
      

  4.   

    和asm有关的包应该是两个吧,我是都给删掉了。然后Build Path,把有问题的包都用可以的换下。我是这么弄了就好了。