我正在尝试在 JBOSS AS 7.1.1 中配置休眠
我只将persistence.xml 放在WEB-INF 文件夹中
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="actionBazaar" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/ActionBazaarDS</jta-data-source>
<properties>
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
Obs:JBOSS 7.1.1 有一个带有休眠 4 的模块,我有一个名为 java:/ActionBazaarDS 的数据源
但我得到这个错误:
Can't find a persistence unit named actionBazaar in deployment "ActionBazaar.war"
当我尝试使用时:
@PersistenceContext(unitName="actionBazaar")
private EntityManager entityManager;