ClassNotFoundException org hibernate engine FilterDefinition

我的未来我决定 提交于 2021-02-05 08:49:05

问题


ClassNotFoundException org hibernate engine FilterDefinition

Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition

Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 25 more

I am new to hibernate+spring and don't know why this error arises while running my application.


回答1:


This is how I solve it.

If you are using below into your XML file:

<bean id="sessionFactory" 
     class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> 

change to hibernate4 same as below:

<bean id="sessionFactory" 
     class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">

From Hibernate 4+ use the LocalSessionFactoryBean.




回答2:


check class file of hibernate local session factory belongs to relevant jar files;

class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> 

change to

class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">


来源:https://stackoverflow.com/questions/42036672/classnotfoundexception-org-hibernate-engine-filterdefinition

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!