4 Replies Latest reply on Feb 21, 2013 11:37 AM by piwaf

    DuplicateServiceException configuring Merlia XA JDBC Driver

    muza71

      Hi,

      I tried to configure on a clean Jboss 7.1.1-final installation the actual Merlia 8.02 JDBC driver. If I configure the "normal" jdbc driver, JBoss starts without any exception. If I configure the XA Datasource I get following exception and Jboss stops booting up: (There are no other changes in the configuration file, only the JDBC Driver !)

       

       

      12:37:52,603 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem

      12:37:52,662 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

      12:37:52,722 INFO  [org.jboss.as.security] (MSC service thread 1-3) JBAS013100: Current PicketBox version=4.0.7.Final

      12:37:52,887 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class com.inet.tds.TdsDriver (version 8.2)

      12:37:52,904 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class com.inet.pool.PoolDriver (version 1.27)

      12:37:52,907 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 27) JBAS014612: Operation ("add") failed - address: ([

          ("subsystem" => "datasources"),

          ("jdbc-driver" => "merlia")

      ]): org.jboss.msc.service.DuplicateServiceException: Service jboss.jdbc-driver.merlia is already registered

              at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:227) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.as.controller.OperationContextImpl$ContextServiceBuilder.install(OperationContextImpl.java:955) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.connector.subsystems.datasources.JdbcDriverAdd.startDriverServices(JdbcDriverAdd.java:164) [jboss-as-connector-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.connector.subsystems.datasources.JdbcDriverAdd.performRuntime(JdbcDriverAdd.java:128) [jboss-as-connector-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:50) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:200) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.connector.subsystems.datasources.DataSourceEnable$1.execute(DataSourceEnable.java:91) [jboss-as-connector-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:200) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.controller.ParallelBootOperationStepHandler$ParallelBootTask.run(ParallelBootOperationStepHandler.java:311) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

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

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

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

              at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]

       

       

      Configuration with the "normal" driver, this works without any problems:

       

      <datasources>

                      <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">

                          <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>

                          <driver>h2</driver>

                          <security>

                              <user-name>sa</user-name>

                              <password>sa</password>

                          </security>

                      </datasource>

                      <drivers>

                          <driver name="h2" module="com.h2database.h2">

                              <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                          </driver>

                          <driver name="merlia" module="com.merlia">

                              <driver-class>com.inet.tds.TdsDriver</driver-class>

                          </driver>

                      </drivers>

                  </datasources>

       

      Configuration with the XA Driver (error: org.jboss.msc.service.DuplicateServiceException: Service jboss.jdbc-driver.merlia is already registered):

       

      <datasources>

                      <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">

                          <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>

                          <driver>h2</driver>

                          <security>

                              <user-name>sa</user-name>

                              <password>sa</password>

                          </security>

                      </datasource>

                      <drivers>

                          <driver name="h2" module="com.h2database.h2">

                              <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                          </driver>

                          <driver name="merlia" module="com.merlia">

                              <xa-datasource-class>com.inet.tds.DTCDataSource</xa-datasource-class>

                          </driver>

                      </drivers>

                  </datasources>

       

      Does anybody has any ideas ?

       

      Thank you

      Juergen

        • 1. Re: DuplicateServiceException configuring Merlia XA JDBC Driver
          muza71

          Does anybody has any ideas ?

          Thank you

          Jürgen

          • 2. Re: DuplicateServiceException configuring Merlia XA JDBC Driver
            lafr

            I tried to reproduce.

            But I used 7.2.0.Alpha1 snapshot, not 7.1.1.Final.

             

            I downloaded merlia_trial_8.02, extracted it, copied Merlia.jar to the JBoss-deployments folder and added the XA-driver as you did:

             

                <subsystem xmlns="urn:jboss:domain:datasources:1.1">
                    <datasources>
                        <drivers>
                            <driver name="ifxjdbc_all.jar" module="undefined">
                                <xa-datasource-class>com.informix.jdbcx.IfxXADataSource</xa-datasource-class>
                            </driver>
                            <driver name="ojdbc6.jar" module="undefined">
                                <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
                            </driver>
                            <driver name="sqljdbc4.jar" module="undefined">
                                <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
                            </driver>
                            <driver name="merlia" module="com.merlia">
                                <xa-datasource-class>com.inet.tds.DTCDataSource</xa-datasource-class>
                            </driver>
                        </drivers>
                    </datasources>
                </subsystem>

             

            On startup then I see

            20:31:42,990 INFO  [org.jboss.as.server.deployment#start] JBAS015876: Starting deployment of "ojdbc6.jar"

            20:31:42,990 INFO  [org.jboss.as.server.deployment#start] JBAS015876: Starting deployment of "Merlia.jar"

            20:31:43,113 INFO  [org.jboss.as.server.deployment#start] JBAS015876: Starting deployment of "ifxjdbc_all.jar"

            20:31:43,116 INFO  [org.jboss.as.server.deployment#start] JBAS015876: Starting deployment of "sqljdbc4.jar"

            20:31:49,057 INFO  [org.jboss.as.connector.deployers.jdbc#deploy] JBAS010403: Deploying JDBC-compliant driver class com.inet.tds.TdsDriver (version 8.2)

            20:31:49,311 INFO  [org.jboss.as.connector.deployers.jdbc#deploy] JBAS010403: Deploying JDBC-compliant driver class com.inet.pool.PoolDriver (version 1.27)

            20:31:49,363 INFO  [org.jboss.as.connector.deployers.jdbc#deploy] JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0)

            20:31:49,368 INFO  [org.jboss.as.connector.deployers.jdbc#deploy] JBAS010403: Deploying JDBC-compliant driver class com.informix.jdbc.IfxDriver (version 3.70)

            20:31:49,778 INFO  [org.jboss.as.connector.deployers.jdbc#deploy] JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)

            20:31:50,184 INFO  [org.jboss.as.server#execute] JBAS018559: Deployed "Merlia.jar"

            20:31:50,186 INFO  [org.jboss.as.server#execute] JBAS018559: Deployed "sqljdbc4.jar"

            20:31:50,187 INFO  [org.jboss.as.server#execute] JBAS018559: Deployed "ojdbc6.jar"

            20:31:50,188 INFO  [org.jboss.as.server#execute] JBAS018559: Deployed "ifxjdbc_all.jar"

            No error!

             

            What are you doing different?

            I doubt that the different JBoss version is the cause.

             

            Just for interest: why you (want to) use this driver and not the one from Microsoft?

            • 3. Re: DuplicateServiceException configuring Merlia XA JDBC Driver
              ctomc

              I have used Merlia for quite some time now and there ware no issues..

               

               

              this is my config:

               

                                  <driver name="merlia" module="com.inet.tds">
                                      <driver-class>
                                          com.inet.tds.TdsDriver
                                      </driver-class>
                                      <xa-datasource-class>
                                          com.inet.tds.XDataSource
                                      </xa-datasource-class>
                                  </driver>
              

               

              datasource config is:

               <datasource jndi-name="java:/app/DS" pool-name="app-pool">
                                  <connection-url>
                                      jdbc:inetdae7a:db.host?database=db.name
                                  </connection-url>
                                  <driver>
                                      merlia
                                  </driver>
                                  <security>
                                      <user-name>
                                          username
                                      </user-name>
                                      <password>
                                          password
                                      </password>
                                  </security>
                              </datasource>
              

               

               

              --

              tomaz

              • 4. Re: DuplicateServiceException configuring Merlia XA JDBC Driver
                piwaf

                I found the secret to be that you need to define bot the driver-class and the xa-datasource-class in driver defenition.  Juegen like myself, defined only the xa-datasource-class, which leads to that very helpful "already registered" exception.  Added the driver-class element as well seemed to solve it.

                 

                Another Merlia oddity I found, is that the names of the xa-datasource-property elements needed to be camel case and not all lower case like the merlia doc says.  And note like it works with other app servers, like weblogic for example.  The property names need to basically be the names of the set methods on the driver class, without the set part.