首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

加载Hibernate的报错了,求解。解决办法

2013-09-11 
加载Hibernate的报错了,求解。加载Hibernate的报错了,求解。Caused by: org.springframework.beans.factory.

加载Hibernate的报错了,求解。
加载Hibernate的报错了,求解。
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pmTransactionManager' defined in ServletContext resource [/pm/conf/pm_spring_persistence.xml]: Cannot resolve reference to bean 'pmEntityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pmEntityManagerFactory' defined in ServletContext resource [/pm/conf/pm_spring_persistence.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pmEntityManagerFactory' defined in ServletContext resource [/pm/conf/pm_spring_persistence.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
Caused by: javax.persistence.PersistenceException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
at org.springframework.orm.jpa.LocalEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalEntityManagerFactoryBean.java:85)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:237)
 


[解决办法]
配置文件找不到。
[解决办法]
lz这个文件/pm/conf/pm_spring_persistence.xml 里的 bean配置项pmTransactionManager 的ref引用pmEntityManagerFactory有问题。lz仔细看看
[解决办法]
难道是没有设置方言dialect?
[解决办法]
pmTransactionManager这个的配置信息找不到
[解决办法]
pmTransactionManager这个的配置信息找不到 

[解决办法]
Cannot resolve reference to bean 'pmEntityManagerFactory' while setting bean property 'entityManagerFactory';

一个是pmEntityManagerFactory一个是entityManagerFactory吧
[解决办法]
Caused by: javax.persistence.PersistenceException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set

你什么数据库?设置的什么方言?

mysql的话:hibernate.dialect是

org.hibernate.dialect.MySQLDialect

或者写你自己的方言继承至哪个方言也可以、
[解决办法]
数据库方言没有设置,要你明确的指定数据库方言!

热点排行