Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframe.orm.hibernate3.HibernateTemplate] for bean with name 'hibernateTemplate' defined in class path resource [beans.xml]; nested exception is java.lang.ClassNotFoundException: org.springframe.orm.hibernate3.HibernateTemplate
Caused by: java.lang.ClassNotFoundException: org.springframe.orm.hibernate3.HibernateTemplate
我已经把需要的包都导入进去了
BEANS.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" 
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">    <!-- 配置数据源 -->
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/test"/>
        <property name="username" value="root"/>
        <property name="password" value=""/>
    </bean>
        <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>com/sise/spring/po/Student.hbm.xml</value>
</list>
</property>
        <!-- 配置Hibernate的SessionFactory的属性 -->
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                <prop key="hibernate.hbm2ddl.auto">update</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hibernate.format_sql">true</prop>
            </props>
        </property>
    </bean>
    <!-- 配置HibernateTemplate -->
    <bean id="hibernateTemplate" class="org.springframe.orm.hibernate3.HibernateTemplate">
        <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
    <!-- 配置Student持久化类的DAO Bean -->
    <bean id="studentDao" class="com.sise.spring.dao.impl.StudentDaoImpl">
        <property name="hibernateTemplate" ref="hibernateTemplate"/>
    </bean>
    <!-- 配置业务实现类 -->
    <bean id="studentService" class="com.sise.spring.service.impl.StudentServiceImpl">
        <property name="studentDao" ref="studentDao"></property>
    </bean>
</beans>

解决方案 »

  1.   

    LZ是COPY到服务器里的lib下了?
      

  2.   

    org.springframe.orm.hibernate3.HibernateTemplate
    这个是什么东西?
    springframework好不?配置自己再改改吧。。
      

  3.   

    org.springframe.orm.hibernate3.HibernateTemplate
    这个类在org.springframe.orm-x.x.jar这个包,你加了没在说你在类里输入org.springframe.orm.hibernate3.HibernateTemplate
    ,按住ctrl,用鼠标一点能进去的话,就说明加到项目里了,
      

  4.   

    Caused by: java.lang.ClassNotFoundException: org.springframe.orm.hibernate3.HibernateTemplate看这句应该是差jar包的问题