我正在尝试使用hibernate来保存我的数据并在JBoss AS 7.1.0
服务器上部署此应用程序。
这是我的persistence.xml
文件:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
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_2_0.xsd">
<persistence-unit name="EmployeeService"> <!-- transaction-type="JTA" -->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/PostgreDS</jta-data-source>
<class>jpa.Employee</class>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
</properties>
</persistence-unit>
</persistence>
我已经配置了数据源,但是当我尝试部署应用程序时,我仍然在日志中遇到此异常。
can't find a persistence unit named ...
因此服务器无法绕过INSTALL阶段。