问题
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