2014-11-23 3 views
0

JSF 프로젝트에 JPA 엔티티를 추가하면 배포가 실패합니다 (성공적이지 않은 경우). 엔티티를 생성하기 위해 넷빈즈 마법사를 사용합니다 (그리고 코드를 확장하지 않습니다). 또한 필자는 maven을 사용하여 응용 프로그램 서버로 Wildfly 8.0을 빌드하고 배포했습니다. 배포는 maven 용 wildfly-plugin에 의해 수행됩니다. 플러그인이 무언가를하지 못하면 던져지는 MojoException과 함께 실패하지만 오류 정보 (-e 또는 -X 매개 변수도 포함하지 않음)가 표시되지 않습니다.JSF 프로젝트에 JPA 엔티티가 포함되어있는 경우

내 최대 절전 종속성

<dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>hibernate-entitymanager</artifactId> 
    <version>4.3.1.Final</version> 
    <scope>provided</scope> 
</dependency> 
<dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>hibernate-jpamodelgen</artifactId> 
    <version>4.3.1.Final</version> 
    <scope>provided</scope> 
</dependency> 

내 persistence.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="de.wilhelm_UserManagementPU" transaction-type="JTA"> 
     <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> 
     <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source> 
     <exclude-unlisted-classes>false</exclude-unlisted-classes> 
     <properties> 
      <property name="javax.persistence.schema-generation.database.action" value="create"/> 
     </properties> 
    </persistence-unit> 
</persistence> 

나는 "org.hibernate.ejb.HibernatePersistence"로에서 이미 변경된 제공 태그 "org.hibernate.jpa.HibernatePersistenceProvider "(https://docs.jboss.org/author/display/WFLY8/JPA+Reference+Guide?_sscc=t#JPAReferenceGuide-UpdateyourPersistence.xmlforHibernate4.3.0에 따라 최대 절전 모드 4.3.1을 사용하기 때문에)

답변

0

내 터미널에서 야생 플라이 오류 메시지를 발견했습니다 :

Caused by: org.h2.jdbc.JdbcSQLException: Table "APPLICATIONUSER" already exists; SQL statement:     
create table ApplicationUser (id bigint not null, primary key (id)) 

이제 쉽게 해결할 수 있습니다.

관련 문제