1 Reply Latest reply on Oct 14, 2014 3:33 AM by Kogan Moonsamy

    [org.jboss.msc.service.fail] (ServerService Thread Pool -- 68) MSC000001: Failed to start service jboss.persistenceunit

    Kogan Moonsamy Newbie

      Hi All,

       

      I am a total noob with an application server and I currently have a deployment issue with wildfly and I am hoping that i can get some urgent help please.

       

      This is the error from the server log:

       

      11:35:09,848 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-8) JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver                                .jdbc.SQLServerDriver (version 4.0)

      11:35:09,849 INFO  [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016005: Starting Services for CDI deployment: ear-1.0.ear

      11:35:09,854 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-15) JBAS010417: Started Driver service with driver-name = ear-1.0.ear_com.mi                                crosoft.sqlserver.jdbc.SQLServerDriver_4_0

      11:35:09,854 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016008: Starting weld service for deployment ear-1.0.ear

      11:35:09,873 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 68) JBAS011409: Starting Persistence Unit (phase 2 of 2) Service 'ear-1.0.ear#RDBMS'

      11:35:09,873 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 67) JBAS011409: Starting Persistence Unit (phase 2 of 2) Service 'ear-1.0.ear#noCacheRDBM                                S'

      11:35:09,873 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 66) JBAS011409: Starting Persistence Unit (phase 2 of 2) Service 'ear-1.0.ear#containerRD                                BMS'

      11:35:10,089 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 67) HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect

      11:35:10,097 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 66) HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect

      11:35:10,106 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 68) HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect

      11:35:10,241 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 68) MSC000001: Failed to start service jboss.persistenceunit."ear-1.0.ear#RDBMS                                ": org.jboss.msc.service.StartException in service jboss.persistenceunit."ear-1.0.ear#RDBMS": javax.persistence.PersistenceException: [PersistenceUnit: RDBMS                                ] Unable to build Hibernate SessionFactory

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_60]

              at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:474)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

              at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: RDBMS] Unable to build Hibernate SessionFactory

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1225) [hibernate-entitym                                anager-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.access$600(EntityManagerFactoryBuilderImpl.java:119) [hibernate-entitymanager-4.3.                                5.Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:853) [hibernate-entitymanager-4.3.5                                .Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) [hibernate-entitymanager-4.3.5                                .Final.jar:4.3.5.Final]

              at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397) [hibernate-core-4.3.5.Final.jar                                :4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) [hibernate-entitymanager-4.3.5.Fin                                al.jar:4.3.5.Final]

              at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) [jipijapa-hibernate4-3-1.0.1.Final.jar:]

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              ... 8 more

      Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.net1.netswitch.database.KeyGroup column: childKeyCheckValue (should be                                 mapped with insert="false" update="false")

              at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:709) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:731) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:753) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:506) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.RootClass.validate(RootClass.java:270) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.cfg.Configuration.validate(Configuration.java:1358) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1849) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) [hibernate-entitymanager-4.3.5                                .Final.jar:4.3.5.Final]

              ... 13 more

       

       

      11:35:10,241 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 66) MSC000001: Failed to start service jboss.persistenceunit."ear-1.0.ear#conta                                inerRDBMS": org.jboss.msc.service.StartException in service jboss.persistenceunit."ear-1.0.ear#containerRDBMS": javax.persistence.PersistenceException: [Pers                                istenceUnit: containerRDBMS] Unable to build Hibernate SessionFactory

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_60]

              at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:474)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

              at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: containerRDBMS] Unable to build Hibernate SessionFactory

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1225) [hibernate-entitym                                anager-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.access$600(EntityManagerFactoryBuilderImpl.java:119) [hibernate-entitymanager-4.3.                                5.Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:853) [hibernate-entitymanager-4.3.5                                .Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) [hibernate-entitymanager-4.3.5                                .Final.jar:4.3.5.Final]

              at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397) [hibernate-core-4.3.5.Final.jar                                :4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) [hibernate-entitymanager-4.3.5.Fin                                al.jar:4.3.5.Final]

              at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) [jipijapa-hibernate4-3-1.0.1.Final.jar:]

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              ... 8 more

      Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.net1.netswitch.database.KeyGroup column: childKeyCheckValue (should be                                 mapped with insert="false" update="false")

              at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:709) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:731) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:753) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:506) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.RootClass.validate(RootClass.java:270) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.cfg.Configuration.validate(Configuration.java:1358) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1849) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) [hibernate-entitymanager-4.3.5                                .Final.jar:4.3.5.Final]

              ... 13 more

       

       

      11:35:10,241 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 67) MSC000001: Failed to start service jboss.persistenceunit."ear-1.0.ear#noCac                                heRDBMS": org.jboss.msc.service.StartException in service jboss.persistenceunit."ear-1.0.ear#noCacheRDBMS": javax.persistence.PersistenceException: [Persiste                                nceUnit: noCacheRDBMS] Unable to build Hibernate SessionFactory

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_60]

              at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:474)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

              at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: noCacheRDBMS] Unable to build Hibernate SessionFactory

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1225) [hibernate-entitym                                anager-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.access$600(EntityManagerFactoryBuilderImpl.java:119) [hibernate-entitymanager-4.3.                                5.Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:853) [hibernate-entitymanager-4.3.5                                .Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) [hibernate-entitymanager-4.3.5                                .Final.jar:4.3.5.Final]

              at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397) [hibernate-core-4.3.5.Final.jar                                :4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) [hibernate-entitymanager-4.3.5.Fin                                al.jar:4.3.5.Final]

              at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) [jipijapa-hibernate4-3-1.0.1.Final.jar:]

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]

              ... 8 more

      Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.net1.netswitch.database.KeyGroup column: childKeyCheckValue (should be                                 mapped with insert="false" update="false")

              at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:709) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:731) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:753) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:506) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.mapping.RootClass.validate(RootClass.java:270) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.cfg.Configuration.validate(Configuration.java:1358) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1849) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) [hibernate-entitymanager-4.3.5                                .Final.jar:4.3.5.Final]

              ... 13 more

       

       

      11:35:10,253 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) JBAS014613: Operation ("deploy") failed - address: ([("depl                                oyment" => "ear-1.0.ear")]) - failure description: {"JBAS014671: Failed services" => {

          "jboss.persistenceunit.\"ear-1.0.ear#RDBMS\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"ear-1.0.ear#RDBMS\": javax.pers                                istence.PersistenceException: [PersistenceUnit: RDBMS] Unable to build Hibernate SessionFactory

          Caused by: javax.persistence.PersistenceException: [PersistenceUnit: RDBMS] Unable to build Hibernate SessionFactory

          Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.net1.netswitch.database.KeyGroup column: childKeyCheckValue (should                                 be mapped with insert=\"false\" update=\"false\")",

          "jboss.persistenceunit.\"ear-1.0.ear#noCacheRDBMS\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"ear-1.0.ear#noCacheRDBMS                                \": javax.persistence.PersistenceException: [PersistenceUnit: noCacheRDBMS] Unable to build Hibernate SessionFactory

          Caused by: javax.persistence.PersistenceException: [PersistenceUnit: noCacheRDBMS] Unable to build Hibernate SessionFactory

          Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.net1.netswitch.database.KeyGroup column: childKeyCheckValue (should                                 be mapped with insert=\"false\" update=\"false\")",

          "jboss.persistenceunit.\"ear-1.0.ear#containerRDBMS\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"ear-1.0.ear#containerR                                DBMS\": javax.persistence.PersistenceException: [PersistenceUnit: containerRDBMS] Unable to build Hibernate SessionFactory

          Caused by: javax.persistence.PersistenceException: [PersistenceUnit: containerRDBMS] Unable to build Hibernate SessionFactory

          Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.net1.netswitch.database.KeyGroup column: childKeyCheckValue (should                                 be mapped with insert=\"false\" update=\"false\")"

      }}

      11:35:10,255 ERROR [org.jboss.as.server] (management-handler-thread - 1) JBAS015870: Deploy of deployment "ear-1.0.ear" was rolled back with the following fa                                ilure message:

      {"JBAS014671: Failed services" => {

          "jboss.persistenceunit.\"ear-1.0.ear#RDBMS\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"ear-1.0.ear#RDBMS\": javax.pers                                istence.PersistenceException: [PersistenceUnit: RDBMS] Unable to build Hibernate SessionFactory

          Caused by: javax.persistence.PersistenceException: [PersistenceUnit: RDBMS] Unable to build Hibernate SessionFactory

          Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.net1.netswitch.database.KeyGroup column: childKeyCheckValue (should                                 be mapped with insert=\"false\" update=\"false\")",

          "jboss.persistenceunit.\"ear-1.0.ear#noCacheRDBMS\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"ear-1.0.ear#noCacheRDBMS                                \": javax.persistence.PersistenceException: [PersistenceUnit: noCacheRDBMS] Unable to build Hibernate SessionFactory

          Caused by: javax.persistence.PersistenceException: [PersistenceUnit: noCacheRDBMS] Unable to build Hibernate SessionFactory

          Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.net1.netswitch.database.KeyGroup column: childKeyCheckValue (should                                 be mapped with insert=\"false\" update=\"false\")",

          "jboss.persistenceunit.\"ear-1.0.ear#containerRDBMS\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"ear-1.0.ear#containerR                                DBMS\": javax.persistence.PersistenceException: [PersistenceUnit: containerRDBMS] Unable to build Hibernate SessionFactory

          Caused by: javax.persistence.PersistenceException: [PersistenceUnit: containerRDBMS] Unable to build Hibernate SessionFactory

          Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.net1.netswitch.database.KeyGroup column: childKeyCheckValue (should                                 be mapped with insert=\"false\" update=\"false\")"

      }}

       

      Actions Taken by Myself:

      - The above error mentions a repeated column in one of my JPA entites (KeyGroup) so just to make sure, I removed this class from my persistence-unit's. After deploying again, I received the same error.

      - I search google for the error and found the below link with a similar error description and decided to change my persistence.xml to match the one on the link.

      org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.service.classloading.spi.ClassLo…

       

      The development is being on IntelliJ, using maven to build. I am running the below command to deploy:

      mvn wildfly:deploy

       

      Persistence.xml : (With the above mentioned changes)

       

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

      <persistence version="2.0" 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_2_0.xsd">

          <persistence-unit name="RDBMS" transaction-type="RESOURCE_LOCAL">

              <!--provider>org.hibernate.jpa.HibernatePersistenceProvider</provider-->

              <jta-data-source>java:/MSAcq</jta-data-source>

              <!--class>com.net1.netswitch.database.KeyGroup</class-->

              <class>com.net1.netswitch.database.Channels</class>

              <class>com.net1.netswitch.database.Bin</class>

              <class>com.net1.netswitch.database.ExternalResponseCodes</class>

              <class>com.net1.netswitch.database.InternalResponseCodes</class>

              <class>com.net1.netswitch.database.InternalExternalResponseCodeMap</class>

              <class>com.net1.netswitch.database.StatusClient</class>

              <class>com.net1.netswitch.database.StatusStandby</class>

              <class>com.net1.netswitch.database.StatusUnit</class>

              <class>com.net1.netswitch.database.StatusUnitClientLinks</class>

              <class>com.net1.netswitch.database.StatusUnitType</class>

              <class>com.net1.netswitch.database.Transaction</class>

              <class>com.net1.netswitch.database.MastercardSmsTransaction</class>

              <class>com.net1.netswitch.database.BankservATMTransaction</class>

              <class>com.net1.netswitch.database.ATMBase24Transaction</class>

              <class>com.net1.netswitch.database.CMFTransaction</class>

              <class>com.net1.netswitch.database.Net1AtmTransaction</class>

              <class>com.net1.netswitch.database.Mcc</class>

              <class>com.net1.netswitch.database.ExceptionEvents</class>

              <class>com.net1.netswitch.database.NotifyGroups</class>

              <class>com.net1.netswitch.database.NotifyUsers</class>

              <class>com.net1.netswitch.database.NotifyStatusLinks</class>

              <class>com.net1.netswitch.database.NotifyGroupUserLinks</class>

              <exclude-unlisted-classes>false</exclude-unlisted-classes>

          <properties>

                  <property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />

                  <property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://x.x.x.x;databaseName=ACQUIRER_SETTLEMENT" />

                  <!-- nedbankserver.net1.com

                      com.mysql.jdbc.Driver

                  -->

                  <property name="javax.persistence.jdbc.user" value="xxx" />

                  <property name="javax.persistence.jdbc.password" value="xxx" />

                  <property name="hbm2ddl.auto" value="none" />

                  <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>

                  <property name="hibernate.connection.url" value="jdbc:sqlserver://x.x.x.x;databaseName=ACQUIRER_SETTLEMENT"/>

                  <property name="hibernate.connection.driver_class" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

                  <property name="hibernate.connection.username" value="xxx"/>

                  <property name="hibernate.connection.password" value="xxx"/>

                  <property name="hibernate.c3p0.min_size" value="5"/>

                  <property name="hibernate.c3p0.max_size" value="32"/>

                  <property name="hibernate.c3p0.timeout" value="15"/>

                  <property name="hibernate.c3p0.max_statements" value="10"/>

                  <property name="hibernate.c3p0.idle_test_period" value="300"/>

                  <property name="hibernate.c3p0.unreturnedConnectionTimeout" value="95"/>

                  <property name="hibernate.c3p0.debugUnreturnedConnectionStackTraces" value="true"/>

                  <property name="hibernate.show_sql" value ="true"/>

              </properties>

          </persistence-unit>

          <persistence-unit name="ODB" transaction-type="RESOURCE_LOCAL">

              <provider>com.objectdb.jpa.Provider</provider>

              <properties>

                  <property name="javax.persistence.jdbc.url" value="objectdb://localhost:6136/something_transactions.odb"/>

                  <property name="javax.persistence.jdbc.user" value="xxx"/>

                  <property name="javax.persistence.jdbc.password" value="xxx"/>

              </properties>

          </persistence-unit>

          <persistence-unit name="noCacheRDBMS" transaction-type="RESOURCE_LOCAL">

              <!--provider>org.hibernate.jpa.HibernatePersistenceProvider</provider-->

              <jta-data-source>java:/MSAcq</jta-data-source>

              <!--class>com.net1.netswitch.database.KeyGroup</class-->

              <class>com.net1.netswitch.database.Channels</class>

              <class>com.net1.netswitch.database.Bin</class>

              <class>com.net1.netswitch.database.ExternalResponseCodes</class>

              <class>com.net1.netswitch.database.InternalResponseCodes</class>

              <class>com.net1.netswitch.database.InternalExternalResponseCodeMap</class>

              <class>com.net1.netswitch.database.StatusClient</class>

              <class>com.net1.netswitch.database.StatusStandby</class>

              <class>com.net1.netswitch.database.StatusUnit</class>

              <class>com.net1.netswitch.database.StatusUnitClientLinks</class>

              <class>com.net1.netswitch.database.StatusUnitType</class>

              <class>com.net1.netswitch.database.Transaction</class>

              <class>com.net1.netswitch.database.MastercardSmsTransaction</class>

              <class>com.net1.netswitch.database.BankservATMTransaction</class>

              <class>com.net1.netswitch.database.ATMBase24Transaction</class>

              <class>com.net1.netswitch.database.CMFTransaction</class>

              <class>com.net1.netswitch.database.Net1AtmTransaction</class>

              <class>com.net1.netswitch.database.Mcc</class>

              <class>com.net1.netswitch.database.ExceptionEvents</class>

              <class>com.net1.netswitch.database.NotifyGroups</class>

              <class>com.net1.netswitch.database.NotifyUsers</class>

              <class>com.net1.netswitch.database.NotifyStatusLinks</class>

              <class>com.net1.netswitch.database.NotifyGroupUserLinks</class>

              <exclude-unlisted-classes>false</exclude-unlisted-classes>

              <properties>

                  <property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />

                  <property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://x.x.x.x;databaseName=ACQUIRER_SETTLEMENT" />

                  <property name="javax.persistence.jdbc.user" value="xxxx" />

                  <property name="javax.persistence.jdbc.password" value="xxxx" />

                  <property name="hbm2ddl.auto" value="none" />

                  <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>

                  <property name="hibernate.connection.url" value="jdbc:sqlserver://x.x.x.x;databaseName=ACQUIRER_SETTLEMENT"/>

                  <property name="hibernate.connection.driver_class" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

                  <property name="hibernate.connection.username" value="xxxx"/>

                  <property name="hibernate.connection.password" value="xxxx"/>

                  <property name="hibernate.show_sql" value ="true"/>

                  <property name="hibernate.cache.use_second_level_cache" value="false"/>

                  <property name="hibernate.cache.use_query_cache" value="false" />

                  <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>

              </properties>

          </persistence-unit>

          <persistence-unit name="containerRDBMS" transaction-type="JTA">

              <!--provider>org.hibernate.jpa.HibernatePersistenceProvider</provider-->

              <jta-data-source>java:/MSAcq</jta-data-source>

              <!--class>com.net1.netswitch.database.KeyGroup</class-->

              <class>com.net1.netswitch.database.Channels</class>

              <class>com.net1.netswitch.database.Bin</class>

              <class>com.net1.netswitch.database.ExternalResponseCodes</class>

              <class>com.net1.netswitch.database.InternalResponseCodes</class>

              <class>com.net1.netswitch.database.InternalExternalResponseCodeMap</class>

              <class>com.net1.netswitch.database.StatusClient</class>

              <class>com.net1.netswitch.database.StatusStandby</class>

              <class>com.net1.netswitch.database.StatusUnit</class>

              <class>com.net1.netswitch.database.StatusUnitClientLinks</class>

              <class>com.net1.netswitch.database.StatusUnitType</class>

              <class>com.net1.netswitch.database.Transaction</class>

              <class>com.net1.netswitch.database.MastercardSmsTransaction</class>

              <class>com.net1.netswitch.database.BankservATMTransaction</class>

              <class>com.net1.netswitch.database.ATMBase24Transaction</class>

              <class>com.net1.netswitch.database.CMFTransaction</class>

              <class>com.net1.netswitch.database.Net1AtmTransaction</class>

              <class>com.net1.netswitch.database.Mcc</class>

              <class>com.net1.netswitch.database.ExceptionEvents</class>

              <class>com.net1.netswitch.database.NotifyGroups</class>

              <class>com.net1.netswitch.database.NotifyUsers</class>

              <class>com.net1.netswitch.database.NotifyStatusLinks</class>

              <class>com.net1.netswitch.database.NotifyGroupUserLinks</class>

              <exclude-unlisted-classes>false</exclude-unlisted-classes>

              <properties>

                  <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>

                  <property name="hibernate.show_sql" value="true"/>

                  <property name="hbm2ddl.auto" value="validate" />

              </properties>

          </persistence-unit>

      </persistence>

       

      KeyGroup JPA entuty:

       

      @Entity(name = "keystore")

      @Table(name = "keystore")

      public class KeyGroup implements Serializable

      {

       

       

          String source;

          private String parentKey;

          private String parentKeyCheckValue;

          private String parentKeyParity;

          private String childKey;

          private String childKeyCheckValue;

          private String childKeyParity;

       

          @Id

          @Column(name = "source")

          public String getSource()

          {

              return source;

          }

       

          @Column(name = "parentKey")

          public String getParentKey()

          {

              return parentKey;

          }

       

       

          @Column(name = "parentKeyCheckValue")

          public String getParentKeyCheckValue()

          {

              return parentKeyCheckValue;

          }

       

          @Column(name = "parentKeyParity")

          public String getParentKeyParity()

          {

              return parentKeyParity;

          }

       

          @Column(name = "childKey")

          public String getChildKey()

          {

              return childKey;

          }

       

          @Column(name = "childKeyCheckValue")

          public String getChildKeyCheckValue()

          {

              return childKeyCheckValue;

          }

       

          @Column(name = "childKeyParity")

          public String getChildKeyParity()

          {

              return childKeyParity;

          }

       

          public void setParentKey(String parentKey)

          {

              this.parentKey = parentKey;

          }

       

          public void setParentKeyCheckValue(String parentKeyCheckValue)

          {

              this.parentKeyCheckValue = parentKeyCheckValue;

          }

       

          public void setParentKeyParity(String parentKeyParity)

          {

              this.parentKeyParity = parentKeyParity;

          }

       

          public void setChildKey(String childKey)

          {

              this.childKey = childKey;

          }

       

          public void setChildKeyCheckValue(String childKeyCheckValue)

          {

              this.childKeyCheckValue = childKeyCheckValue;

          }

       

          public void setChildKeyParity(String childKeyParity)

          {

              this.childKeyParity = childKeyParity;

          }

       

          @Transient

          public byte[] getParentKeyBytes()

          {

              if (parentKey == null) return null;

              return parentKey.getBytes();

          }

       

          @Transient

          public byte[] getParentKeyCheckValueBytes()

          {

              if (parentKeyCheckValue == null) return null;

              return parentKeyCheckValue.getBytes();

          }

       

          @Transient

          public byte[] getParentKeyParityBytes()

          {

              if (parentKeyParity == null) return null;

              return parentKeyParity.getBytes();

          }

       

          @Transient

          public byte[] getChildKeyBytes()

          {

              if (childKey == null) return null;

              return childKey.getBytes();

          }

       

          @Transient

          public byte[] getChildKeyCheckValueBytes()

          {

              if (childKeyCheckValue == null) return null;

              return childKeyCheckValue.getBytes();

          }

       

          @Transient

          public byte[] getChildKeyParityBytes()

          {

              if (childKeyParity == null) return null;

              return childKeyParity.getBytes();

          }

       

          public void setSource(String source)

          {

              this.source = source;

          }

       

          public void setParentKeyBytes(byte[] key)

          {

              this.parentKey = new String(key);

          }

       

          public void setParentKeyCheckValueBytes(byte[] key)

          {

              this.parentKeyCheckValue = new String(key);

          }

       

          public void setParentKeyParityBytes(byte[] key)

          {

              this.parentKeyParity = new String(key);

          }

       

          public void setChildKeyBytes(byte[] key)

          {

              this.childKey = new String(key);

          }

       

          public void setChildKeyCheckValueBytes(byte[] key)

          {

              this.childKeyCheckValue = new String(key);

          }

       

          public void setChildKeyParityBytes(byte[] key)

          {

              this.childKeyParity = new String(key);

          }

       

          //StringBuilder sb;

          public String toString()

          {

              StringBuilder sb = new StringBuilder();

              sb.append("source: '" + source + "'");

              sb.append("parentKey: '");

              if (parentKey != null) sb.append(new String(parentKey));

              else sb.append("null");

              sb.append("' parentKeyCheckValue: '");

              if (parentKeyCheckValue != null) sb.append(new String(parentKeyCheckValue));

              else sb.append("null");

              sb.append("' parentKeyParity: '");

              if (parentKeyParity != null) sb.append(new String(parentKeyParity));

              else sb.append("null");

              sb.append("' childKey: '");

              if (childKey != null) sb.append(new String(childKey));

              else sb.append("null");

              sb.append("' childKeyCheckValue: '");

              if (childKeyCheckValue != null) sb.append(new String(childKeyCheckValue));

              else sb.append("null");

              sb.append("' childKeyParity: '");

              if (childKeyParity != null) sb.append(new String(childKeyParity));

              else sb.append("null");

              sb.append("'");

       

            /* this could really benefit from less hard-coded fields and something more like a traversable map of fields */

              return sb.toString();

          }

       

          @Override

          public boolean equals(Object o)

          {

              if (this == o)

                  return true;

       

              if (! (o instanceof KeyGroup))

                  return false;

       

              final KeyGroup other = (KeyGroup) o;

       

              if (getChildKey() != null ? !getChildKey().equals(other.getChildKey()) : other.getChildKey() != null)

                  return false;

       

              if (getParentKey() != null ? !getParentKey().equals(other.getParentKey()) : other.getParentKey() != null)

                  return false;

       

              if (getSource() != null ? !getSource().equals(other.getSource()) : other.getSource() != null)

                  return false;

       

              return true;

          }

       

          @Override

          public int hashCode()

          {

              int result = 17;

       

              result = 31 * result + (getParentKey() != null ? getParentKey().hashCode() : 0);

              result = 31 * result + (getChildKey() != null ? getChildKey().hashCode() : 0);

              result = 31 * result + (getSource() != null ? getSource().hashCode() : 0);

       

              return result;

          }

      }

       

      P.S, an ex colleague of mine did the entire setup, so I am currently still learning everything.

       

      If you guys require any further info, please do not hesitate to ask.

       

      Thanks in advance guys and gals.

       

      Regards

      Kogan