我收到以下错误:
在类路径资源 [jpaDaoContext.xml] 中定义名称为“org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0”的 bean 创建错误:bean 初始化失败;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建类路径资源 [jpaDaoContext.xml] 中定义的名称为“vodEntityManagerFactory”的 bean 时出错:调用 init 方法失败;嵌套异常是 javax.persistence.PersistenceException: [PersistenceUnit: vodPersistenceUnit] 找不到类或包
我在谷歌上看了一下,被告知要选择 transaction-type=RESOURCE_LOCAL 但设置已经是这样了。这些设置有什么问题:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- transaction-type is RESOURCE_LOCAL or JTA -->
<persistence-unit name="vodPersistenceUnit"
transaction-type="RESOURCE_LOCAL">
<class>mypackage.persistent.HistoriqueAction</class>
<class>mypackage.persistent.ParametresTechniques</class>
<class>mypackage.persistent.TicketType</class>
<class>mypackage.persistent.TransactionType</class>
<class>mypackage.persistent.StatutSession</class>
<class>mypackage.persistent.Statistique</class>
<class>mypackage.persistent.StatUser</class>
<!-- Avoid to scan *.class and *.hbm.xml -->
<exclude-unlisted-classes />
</persistence-unit>
</persistence>
问候