Hibernate Configuration.xml

时间:2017-02-19 21:21:11

标签: xml hibernate configuration

嗨我在eclipse上有这个例外     在

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
15:07:49,089 INFO  [stdout] (default task-3)
at java.lang.Thread.run(Thread.java:745)
15:07:49,089 INFO  [stdout] (default task-3) Caused by: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration 15:07:49,089 INFO  [stdout] (default task-3)
at esik.telstudo.com.rest.util.HibernateUtil.buildSessionFactory(HibernateUtil.java:14)
15:07:49,089 INFO  [stdout] (default task-3)
... 121 more
15:07:49,090 INFO  [stdout] (default task-3) Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration from [Module "deployment.TelstudoAdmin.war:main" from Service Module Loader] 15:07:49,090 INFO  [stdout] (default task-3)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198) 
15:07:49,090 INFO  [stdout] (default task-3)
at org.jboss.modules.ConcurrentClassLoader.performL

我的hibernate.cfg.xml就像这样

<session-factory>


   <!-- Pool SQLServer Local -->

  <property name="connection.datasource">java:/TelstudoAdmin</property>
  <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

  <!---->

    <!-- Disable the second-level cache  -->
    <property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>

    <!-- Echo all executed SQL to stdout -->
    <property name="show_sql">true</property>

    <!-- Drop and re-create the database schema on startup
    <property name="hbm2ddl.auto">update</property>
    <property name="hbm2ddl.auto">create
    --> 
    <property name="hbm2ddl.auto">update</property>

    <!-- Names the annotated entity class -->
    <mapping class="esik.telstudo.com.core.Productos"/>
</session-factory>

请问我做错了

1 个答案:

答案 0 :(得分:0)

org / hibernate / cfg /配置类缺失。请将Hibernate jar添加到classpath并再次执行程序。