小弟SSH新手 测试项目中 实现的是一个user表的增删改查,在java普通项目中能够执行成功
但是移植到web项目就不行了 这是报错信息警告: recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in file [E:\Myeclise_workplace\spring_hibernate_3\WebRoot\WEB-INF\classes\applicationContext-beans.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\Myeclise_workplace\spring_hibernate_3\WebRoot\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/persistence/EntityListenersError creating bean with name 'sessionFactory' defined in file [E:\Myeclise_workplace\spring_hibernate_3\WebRoot\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/persistence/EntityListenersCaused by: java.lang.ClassNotFoundException: javax.persistence.EntityListeners是什么原因呢?求指导
但是移植到web项目就不行了 这是报错信息警告: recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in file [E:\Myeclise_workplace\spring_hibernate_3\WebRoot\WEB-INF\classes\applicationContext-beans.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\Myeclise_workplace\spring_hibernate_3\WebRoot\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/persistence/EntityListenersError creating bean with name 'sessionFactory' defined in file [E:\Myeclise_workplace\spring_hibernate_3\WebRoot\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/persistence/EntityListenersCaused by: java.lang.ClassNotFoundException: javax.persistence.EntityListeners是什么原因呢?求指导
缺少hibernate-jpa-2.0-api-1.0.0.Final.jar,这个jar包在Hibernate3.6的lib的jpa下,加入项目的buildpath,再次运行工程,OK了。 现在出现了 一个信息: Not binding factory to JNDI, no JNDI name configured
正在探索中 麻烦能解决的告诉下
看看这个hibernate-jpa-2.0-api-1.0.0.Final.jar