I have an Entreprise Application Project EAR : ( WAR + JAR EJB ) when i deploy on Wildfly The EJB Project separately , i don't have any persistance problem but when i deploy the Ear I get the following error:
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"
this is my Persistan.xml File :
<?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>