org.hibernate.HibernateException:无法实例化QueryTranslatorFactory:org.hibernate.hql.class...

栏目: Java · 发布时间: 5年前

内容简介:翻译自:https://stackoverflow.com/questions/5582478/org-hibernate-hibernateexception-could-not-instantiate-querytranslatorfactory
为什么当我从hql编辑器运行查询时发生此异常
org.hibernate.HibernateException: could not instantiate QueryTranslatorFactory: org.hibernate.hql.classic.ClassicQueryTransactionFactory
    at org.hibernate.cfg.SettingsFactory.createQueryTranslatorFactory(SettingsFactory.java:391)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:222)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
    at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
    at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:264)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
    at org.hibernate.cfg.SettingsFactory.createQueryTranslatorFactory(SettingsFactory.java:388)
    ... 7 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.hql.classic.ClassicQueryTransactionFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:262)
    ... 13 more

从hibernate 3迁移到hibernate 4时我有同样的异常,但是当我试图改变它时

<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

<property name="hibernate.query.factory_class">org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory</property>

它对我有用.

我希望能帮助你.

翻译自:https://stackoverflow.com/questions/5582478/org-hibernate-hibernateexception-could-not-instantiate-querytranslatorfactory


以上所述就是小编给大家介绍的《org.hibernate.HibernateException:无法实例化QueryTranslatorFactory:org.hibernate.hql.class...》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Science of Programming

The Science of Programming

David Gries / Springer / 1989-4-21 / USD 99.00

Describes basic programming principles and their step-by- step applications.Numerous examples are included.一起来看看 《The Science of Programming》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具