2013-12-08 44 views
0

我已经创建了一个带有POJO类“Employee”的EJB程序,但是在将EJB部署到JBOSS 7.1 AS服务器上时,它没有创建Schema(Schema not Exported)错误。无法在EJB部署上导出架构而无错误

Can Any One建议,程序有什么问题。

服务器日志。

18:43:34445 INFO [org.jboss.as.server](Controller引导螺纹) JBAS018559:已部署 “ojdbc6.jar” 18:43:34456 INFO [org.jboss.as。服务器部署](MSC服务线程1-8)JBAS015876: 开始部署“FirstEJBProject.jar”18:43:34,587信息 [org.jboss.as.jpa](MSC服务线程1-8)JBAS011401:Read Persistence.xml for FirstEJBProject 18:43:34,632 INFO [org.jboss.as.jpa](MSC service thread 1-5)JBAS011402:Starting Persistence Unit Service'FirstEJBProject.jar#FirstEJBProject' 18:43:36,284 INFO [org.hibernate.annotations。 (MSC服务 线程1-5)HHH000412:服务线程1-5(MSC 服务线程1-5)HCANN000001:休眠共享注释 {4.0.1.Final} 18:43:36,375 INFO [org.hibernate.Version] Hibernate Core {4.0.1.Final} 18:43:36,385 INFO [org.hibernate.cfg.Environment](MSC service thread 1-5)HHH000206: hibernate.properties not found 18:43:36,393 INFO [org (MSC服务线程1-5)HHH000020: 字节码提供程序名称:javassist 18:43:36,556 INFO [org.hibernate.ejb.Ejb3Configuration](MSC服务线程1-5) HHH000204:正在处理PersistenceUnitInfo [名称:FirstEJBProject ...] 18:43:36,993信息 [org.hibernate.service.jdbc.connec tions.internal.ConnectionProviderInitiator] (MSC服务线程1-5)HHH000130:实例明确连接 提供商: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider 18:43:37939 INFO [的org.hibernate.dialect.Dialect]( MSC服务线程 1-5)HHH000400:使用方言:org.hibernate.dialect.Oracle10gDialect 18:43:38003 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC服务线程1-5) HHH000268:交易策略: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory 18:43:38,013 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory](MSC 服务线程1-5)HHH000397:使用ASTQueryTranslatorFactory 18:43:38306 INFO [org.hibernate.validator.util.Version](MSC服务 螺纹1-5)Hibernate验证4.2.0.Final 18:43:39301 INFO [org.jboss.as](MSC服务线程1-5)JBAS015951:管理控制台 侦听在http://:9990 18:43:39304 INFO [org.jboss.as] (MSC服务线程1- 5)JBAS015874:JBoss AS 7.1.1.Final“Brontes” 开始于9361ms - 开始180个260个服务(78个服务是 被动或按需)18:43:39,406 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2)JBAS018559:已部署 “FirstEJBProject.jar”

持久性。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="FirstEJBProject"> 

    <jta-data-source>java:/XE</jta-data-source> 
    <class>Persistance.Employee</class> 
    <properties> 
    <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/> 
    <property name="hibernate.hbm2dll.auto" value="create"/> 


    </properties> 
    </persistence-unit> 
</persistence> 

员工POJO类:

package Persistance; 

import java.io.Serializable; 
import java.util.Date; 

import javax.persistence.Entity; 
import javax.persistence.GeneratedValue; 
import javax.persistence.GenerationType; 
import javax.persistence.Id; 
import javax.persistence.Temporal; 
import javax.persistence.TemporalType; 

@Entity 
public class Employee implements Serializable { 

    public Employee() { 
     } 


    private int idEmployee; 
    private String nameEmployee; 
    private String lastNameEmployee; 
    private Date dateNaissance; 
    private String function; 


    @Id 
    @GeneratedValue(strategy=GenerationType.IDENTITY) 
    public int getIdEmployee() { 
     return idEmployee; 
    } 
    public void setIdEmployee(int idEmployee) { 
     this.idEmployee = idEmployee; 
    } 
    public String getNameEmployee() { 
     return nameEmployee; 
    } 
    public void setNameEmployee(String nameEmployee) { 
     this.nameEmployee = nameEmployee; 
    } 
    public String getLastNameEmployee() { 
     return lastNameEmployee; 
    } 
    public void setLastNameEmployee(String lastNameEmployee) { 
     this.lastNameEmployee = lastNameEmployee; 
    } 

    @Temporal(TemporalType.DATE) 
    public Date getDateNaissance() { 
     return dateNaissance; 
    } 
    public void setDateNaissance(Date dateNaissance) { 
     this.dateNaissance = dateNaissance; 
    } 
    public String getFunction() { 
     return function; 
    } 
    public void setFunction(String function) { 
     this.function = function; 
    } 
    public Employee(String nameEmployee, String lastNameEmployee, 
      Date dateNaissance, String function) { 
     super(); 
     this.nameEmployee = nameEmployee; 
     this.lastNameEmployee = lastNameEmployee; 
     this.dateNaissance = dateNaissance; 
     this.function = function; 
    } 






} 

回答

0

我看到两种可能出现的问题与您的部署:

  • persistence.xml文件使用JPA 2.1描述符。 JBoss AS 7.1.1支持2.0及更低版本。如果你想要2.1,你应该使用WildFly。
  • 该类为自动生成的Ids使用IDENTITY策略,并为持久性单元使用Oracle10g方言。 Oracle 10g不支持SQL IDENTITY的概念,因此应该选择不同的策略,如SEQUENCETABLE
相关问题