首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

java.lang.NoClassDefFoundError: org.hibernate.cfg.Configuration 是什么东东?

2012-03-12 
java.lang.NoClassDefFoundError: org.hibernate.cfg.Configuration 是什么错误????xmlversion 1.0 en

java.lang.NoClassDefFoundError: org.hibernate.cfg.Configuration 是什么错误???
<?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   name= "/empLogin "   class= "EmployeeLoginAction ">
                <property   name= "empMgr "   ref= "EmployeeManagerService "/>
        </bean>

<bean   id= "EmployeeManagerService "   class= "EmployeeManagerServiceImpl ">

<property   name= "employeeDAO "   ref= "EmployeeDAO "/>

</bean>

<bean   id= "EmployeeDAO "   class= "EmployeeDAOHibernate "   lazy-init= "true ">
property   name= "employeeDAO "   ref= "EmployeeDAO "/
</bean>

<bean   id= "dataSource "
                    class= "org.springframework.jdbc.datasource.DriverManagerDataSource ">  
                <property   name= "driverClassName "  
                                    value= "oracle.jdbc.driver.OracleDriver "/>
                <property   name= "url "
                                    value= "jdbc:oracle:thin:@localhost:1521:sammi "/>  
                <property   name= "username "   value= "system "/>  
                <property   name= "password "   value= "sammi "/>  
        </bean>

<bean   id= "sessionFactory "    
    class= "org.springframework.orm.hibernate3.LocalSessionFactoryBean "          
    destroy-method= "close ">  
 
    <property   name= "configLocation ">
  <value> hibernate.cfg.xml </value>
    </property>

                <property   name= "dataSource "   ref= "dataSource "/>  
                <property   name= "mappingResources ">  
                        <list>  
                                <value> Employee.hbm.xml </value>  
                        </list>  
                </property>  


                <property   name= "hibernateProperties ">  
                        <props>  
                                <prop   key= "hibernate.dialect ">  
                                        org.hibernate.dialect.Oracle9Dialect
                                </prop>  
                        </props>  
                </property>  

        </bean>  

</beans>

在TOMCAT   中的SSH   这样配置后日志上显示:



[解决办法]
classpath 里少了hibernate3.jar.
[解决办法]
把hibernate3.jar,数据库驱动包等JAVA类,配置文件中用到的JAR包全放在构建路径里
[解决办法]
我和你的错误差不多拉
也是那个 但是我有hibernate3.jar包 
快一天了
还没有解决掉了
[解决办法]
我觉得也像是jar包的问题,
没有加载
org.springframework.orm.hibernate3.LocalSessionFactoryBean]:
Constructor threw exception; nested exception is
类没有定义
java.lang.NoClassDefFoundError: org.hibernate.cfg.Configuration 

给你一个我们的实例了 
<!-- spring 中数据源和sessionFactory的配置 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list><value>classpath:jdbc.properties</value></list>
</property>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${datasource.driverClassName}" />
<property name="url" value="${datasource.url}" />
<property name="username" value="${datasource.username}" />
<property name="password" value="${datasource.password}" />
</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.SQLServerDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
<prop key="hibernate.autoReconnect">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>model/po/Dtproperties.hbm.xml</value>
<value>model/po/Application.hbm.xml</value>
<value>model/po/ProfileInput.hbm.xml</value>


<value>model/po/KillMail.hbm.xml</value>

热点排行