4 Replies Latest reply on Oct 15, 2013 1:05 AM by Sachin Dhingra

    javax.persistence.PersistenceException: [PersistenceUnit: COMTransactions] Unable to build EntityManagerFactory

    Sachin Dhingra Newbie

      Hi,

       

      I have started deployment of my ear file on the JBOSS 7.1.1 final which contains jar and war files. I have EntityBean in my jar file connectiong to database using JPA i.e., persistence.xml file but getting below error:

       

      server.log:

      18:03:20,871 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.persistenceunit."xxxHubEJB.jar#COMTransactions": org.jboss.msc.service.StartException in service jboss.persistenceunit."xxxHubEJB.jar#COMTransactions": Failed to start service

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]

      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: COMTransactions] Unable to build EntityManagerFactory

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)

          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)

          at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)

          at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          ... 3 more

      Caused by: org.hibernate.AnnotationException: Cannot find the expected secondary table: no UPLD_PRGS_RPT available for com.xxx.xxxhubserver.com.entity.TransactionEntityBean

          at org.hibernate.cfg.Ejb3Column.getJoin(Ejb3Column.java:363)

          at org.hibernate.cfg.Ejb3Column.getTable(Ejb3Column.java:342)

          at org.hibernate.cfg.annotations.SimpleValueBinder.make(SimpleValueBinder.java:306)

          at org.hibernate.cfg.annotations.PropertyBinder.makePropertyAndValue(PropertyBinder.java:189)

          at org.hibernate.cfg.annotations.PropertyBinder.makePropertyValueAndBind(PropertyBinder.java:201)

          at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:2011)

          at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:765)

          at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:684)

          at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3406)

          at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3360)

          at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1334)

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1724)

          at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)

          ... 9 more

       

      persistence.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <persistence xmlns="http://java.sun.com/xml/ns/persistence"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"

      version="1.0">

          <persistence-unit name="COMTransactions">

          <description>COM Transactions status checker</description>

              <jta-data-source>jdbc/COMDB</jta-data-source>

              <jar-file>xxxHubEJB.jar</jar-file>

              <class>com.xxx.xxxhubserver.com.entity.TransactionEntityBean</class>

              <class>com.xxx.xxxhubserver.com.sessionbean.UploadDataStatusBean</class>

          </persistence-unit>

      </persistence>

       

      Attaching standalone.xml file.

       

      Please reply and thanks for the help in advance.