无法执行 JPA 架构:服务 jboss.persistenceunit

Unable to execute JPA schema: service jboss.persistenceunit

我有一个企业应用项目 EAR : ( WAR + JAR EJB ) 当我在 Wildfly 上单独部署 EJB 项目时,我没有任何持久性问题,但是当我部署 Ear 时,出现以下错误:

21:13:24,101 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 52) MSC000001: Failed to start service jboss.persistenceunit."BankEar.ear/EJBBANK.jar#persist": org.jboss.msc.service.StartException in service jboss.persistenceunit."BankEar.ear/EJBBANK.jar#persist": javax.persistence.PersistenceException: Unable to execute JPA schema generation create command [create table Compte (code bigint not null, date datetime, solde double precision not null, primary key (code))]

21:13:24,654 WARN [org.jboss.as.jpa] (Controller Boot Thread) JBAS011411: Unexpected problem gathering statistics: java.lang.IllegalStateException: JBAS011477: Persistence unit 'BankEar.ear/EJBBANK.jar#persist' is not available

JBAS014777: Services which failed to start: service jboss.persistenceunit."BankEar.ear/EJBBANK.jar#persist"

这是我的 Persistan.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1"
    xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
    <persistence-unit name="persist" transaction-type="JTA">
        <jta-data-source>java:jboss/datasources/jeeDataSource</jta-data-source>
        <class>com.entity.Compte</class>
        <properties>
        <property name="javax.persistence.schema-generation.database.action"
           value="drop-and-create"/>
        </properties>
    </persistence-unit>
</persistence>

我已经通过使用 属性 访问类型重新创建 JPA 实体解决了这个错误 谢谢!