2

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>
  • there is no Caused by after your javax.persistence.PersistenceException? – mendieta Feb 18 '16 at 20:57
  • Caused by: 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))] Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'Compte' already exists"}} – Ben Elghali Beyram Feb 19 '16 at 18:32

1 Answers1

0

I have resolved this error by re-creating the JPA Entity with Property Acces-Type Thank you!