Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-6195

Valid Wildfly 10.0.0.Final DataSource fails in Wildfly 10.1.0.Final

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.1.0.DR9
    • None
    • JCA
    • None
    • Hide

      The following Wildfly 10.0.0.Final Datasource configuration via CLI...

      # Via CLI
      #    cd C:\dev\tools\wildfly-10.1.0.Final\
      #    bin\jboss-cli.bat
      
      module add \
          --name=org.postgres \
          --resources=C:\Users\user\Downloads\postgresql-9.4.1209.jar \
          --dependencies=javax.api,javax.transaction.api
      
      /subsystem=datasources/jdbc-driver=postgres:add( \
          driver-name="postgres", \
          driver-module-name="org.postgres", \
          driver-class-name=org.postgresql.Driver, \
          driver-datasource-class-name=org.postgresql.ds.PGSimpleDataSource, \
          driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource )
      
      data-source add \
          --name=Postgres_MY_APP_DS \
          --driver-name=postgres \
          --jndi-name=java:/MY_APP_DS \
          --valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker \
          --exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter \
          --connection-url=jdbc:postgresql://localhost:5432/myapp \
          --user-name=myapp \
          --password=myapp
      

      ... will produce the following exception in Wildfly 10.1.0.Final:

      {"WFLYCTL0080: Failed services" => {"org.wildfly.data-source.Postgres_MY_APP_DS" => "org.jboss.msc.service.StartException in service org.wildfly.data-source.Postgres_MY_APP_DS: WFLYJCA0033: Error during the deployment of Postgres_MY_APP_DS
          Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf"},"WFLYCTL0412: Required services that are not installed:" => ["org.wildfly.data-source.Postgres_MY_APP_DS"],"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined}
      

      The following Wildfly 10.0.0.Final Datasource configuration via XML (standalone-full.xml)...

      <subsystem xmlns="urn:jboss:domain:datasources:4.0">
      	<datasources>
      		<datasource jndi-name="java:/MY_APP_DS" pool-name="Postgres_MY_APP_DS">
      			<connection-url>jdbc:postgresql://localhost:5432/myapp</connection-url>
      			<driver>postgres</driver>
      			<security>
      				<user-name>myapp</user-name>
      				<password>myapp</password>
      			</security>
      			<validation>
      				<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
      				<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
      			</validation>
      		</datasource>
      		<drivers>
      			<driver name="postgres" module="org.postgres">
      				<driver-class>org.postgresql.Driver</driver-class>
      				<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
      				<datasource-class>org.postgresql.ds.PGSimpleDataSource</datasource-class>
      			</driver>
      		</drivers>
      	</datasources>
      </subsystem>
      

      ... will produce the following Stacktrace on Wildfly 10.1.0.Final Application Server Startup:

      14:16:16,583 ERROR [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-5) Error during the deployment of java:/MY_APP_DS: javax.resource.ResourceException: IJ031103: At least one connection property must be defined for datasource-class: org.postgresql.ds.PGSimpleDataSource
      	at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createConnectionFactory(LocalManagedConnectionFactory.java:108)
      	at org.jboss.jca.deployers.common.AbstractDsDeployer.deployDataSource(AbstractDsDeployer.java:772)
      	at org.jboss.jca.deployers.common.AbstractDsDeployer.createObjectsAndInjectValue(AbstractDsDeployer.java:312)
      	at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer.deploy(AbstractDataSourceService.java:371)
      	at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:149)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      
      14:16:16,588 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service org.wildfly.data-source.Postgres_MY_APP_DS: org.jboss.msc.service.StartException in service org.wildfly.data-source.Postgres_MY_APP_DS: WFLYJCA0033: Error during the deployment of Postgres_MY_APP_DS
      	at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:163)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf
      	at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:151)
      	... 5 more
      
      .....
      	
      	
      14:16:17,470 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
          ("subsystem" => "datasources"),
          ("data-source" => "Postgres_MY_APP_DS")
      ]) - failure description: {
          "WFLYCTL0080: Failed services" => {"org.wildfly.data-source.Postgres_MY_APP_DS" => "org.jboss.msc.service.StartException in service org.wildfly.data-source.Postgres_MY_APP_DS: WFLYJCA0033: Error during the deployment of Postgres_MY_APP_DS
          Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf"},
          "WFLYCTL0412: Required services that are not installed:" => ["org.wildfly.data-source.Postgres_MY_APP_DS"],
          "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
      }
      14:16:17,473 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
          ("subsystem" => "datasources"),
          ("data-source" => "Postgres_MY_APP_DS")
      ]) - failure description: {
          "WFLYCTL0080: Failed services" => {"org.wildfly.data-source.Postgres_MY_APP_DS" => "org.jboss.msc.service.StartException in service org.wildfly.data-source.Postgres_MY_APP_DS: WFLYJCA0033: Error during the deployment of Postgres_MY_APP_DS
          Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf"},
          "WFLYCTL0412: Required services that are not installed:" => [
              "org.wildfly.data-source.Postgres_MY_APP_DS",
              "org.wildfly.data-source.Postgres_MY_APP_DS"
          ],
          "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
      }
      

      Other examples

      The following configuration is similar and would also fail:

      Show
      The following Wildfly 10.0.0.Final Datasource configuration via CLI... # Via CLI # cd C:\dev\tools\wildfly-10.1.0.Final\ # bin\jboss-cli.bat module add \ --name=org.postgres \ --resources=C:\Users\user\Downloads\postgresql-9.4.1209.jar \ --dependencies=javax.api,javax.transaction.api /subsystem=datasources/jdbc-driver=postgres:add( \ driver-name= "postgres" , \ driver-module-name= "org.postgres" , \ driver- class- name=org.postgresql.Driver, \ driver-datasource- class- name=org.postgresql.ds.PGSimpleDataSource, \ driver-xa-datasource- class- name=org.postgresql.xa.PGXADataSource ) data-source add \ --name=Postgres_MY_APP_DS \ --driver-name=postgres \ --jndi-name=java:/MY_APP_DS \ --valid-connection-checker- class- name=org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker \ --exception-sorter- class- name=org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter \ --connection-url=jdbc:postgresql: //localhost:5432/myapp \ --user-name=myapp \ --password=myapp ... will produce the following exception in Wildfly 10.1.0.Final: { "WFLYCTL0080: Failed services" => { "org.wildfly.data-source.Postgres_MY_APP_DS" => "org.jboss.msc.service.StartException in service org.wildfly.data-source.Postgres_MY_APP_DS: WFLYJCA0033: Error during the deployment of Postgres_MY_APP_DS Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf "}," WFLYCTL0412: Required services that are not installed: " => [" org.wildfly.data-source.Postgres_MY_APP_DS "]," WFLYCTL0180: Services with missing/unavailable dependencies" => undefined} The following Wildfly 10.0.0.Final Datasource configuration via XML (standalone-full.xml)... <subsystem xmlns= "urn:jboss:domain:datasources:4.0" > <datasources> <datasource jndi-name= "java:/MY_APP_DS" pool-name= "Postgres_MY_APP_DS" > <connection-url> jdbc:postgresql://localhost:5432/myapp </connection-url> <driver> postgres </driver> <security> <user-name> myapp </user-name> <password> myapp </password> </security> <validation> <valid-connection-checker class-name= "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker" /> <exception-sorter class-name= "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter" /> </validation> </datasource> <drivers> <driver name= "postgres" module= "org.postgres" > <driver-class> org.postgresql.Driver </driver-class> <xa-datasource-class> org.postgresql.xa.PGXADataSource </xa-datasource-class> <datasource-class> org.postgresql.ds.PGSimpleDataSource </datasource-class> </driver> </drivers> </datasources> </subsystem> ... will produce the following Stacktrace on Wildfly 10.1.0.Final Application Server Startup: 14:16:16,583 ERROR [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-5) Error during the deployment of java:/MY_APP_DS: javax.resource.ResourceException: IJ031103: At least one connection property must be defined for datasource-class: org.postgresql.ds.PGSimpleDataSource at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createConnectionFactory(LocalManagedConnectionFactory.java:108) at org.jboss.jca.deployers.common.AbstractDsDeployer.deployDataSource(AbstractDsDeployer.java:772) at org.jboss.jca.deployers.common.AbstractDsDeployer.createObjectsAndInjectValue(AbstractDsDeployer.java:312) at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer.deploy(AbstractDataSourceService.java:371) at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:149) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:745) 14:16:16,588 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service org.wildfly.data-source.Postgres_MY_APP_DS: org.jboss.msc.service.StartException in service org.wildfly.data-source.Postgres_MY_APP_DS: WFLYJCA0033: Error during the deployment of Postgres_MY_APP_DS at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:163) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:745) Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:151) ... 5 more ..... 14:16:17,470 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread ) WFLYCTL0013: Operation ( "add" ) failed - address: ([ ( "subsystem" => "datasources" ), ( "data-source" => "Postgres_MY_APP_DS" ) ]) - failure description: { "WFLYCTL0080: Failed services" => { "org.wildfly.data-source.Postgres_MY_APP_DS" => "org.jboss.msc.service.StartException in service org.wildfly.data-source.Postgres_MY_APP_DS: WFLYJCA0033: Error during the deployment of Postgres_MY_APP_DS Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf"}, "WFLYCTL0412: Required services that are not installed:" => [ "org.wildfly.data-source.Postgres_MY_APP_DS" ], "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined } 14:16:17,473 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread ) WFLYCTL0013: Operation ( "add" ) failed - address: ([ ( "subsystem" => "datasources" ), ( "data-source" => "Postgres_MY_APP_DS" ) ]) - failure description: { "WFLYCTL0080: Failed services" => { "org.wildfly.data-source.Postgres_MY_APP_DS" => "org.jboss.msc.service.StartException in service org.wildfly.data-source.Postgres_MY_APP_DS: WFLYJCA0033: Error during the deployment of Postgres_MY_APP_DS Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf"}, "WFLYCTL0412: Required services that are not installed:" => [ "org.wildfly.data-source.Postgres_MY_APP_DS" , "org.wildfly.data-source.Postgres_MY_APP_DS" ], "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined } Other examples The following configuration is similar and would also fail: http://www.nailedtothex.org/roller/kyle/entry/registering-postgresql-jdbc-driver-datasource

      My current Wildfly 10.0.0.Final (Non-XA) Datasource configuration will not work for Wildfly 10.1.0.Final. See the "Steps to Reproduce" section.

      The stacktrace points to here:

      The work-around

      Wildfly 10.1.0.Final Datasource configuration via CLI

      	# No parameter to set a connection property value.
      

      Wildfly 10.1.0.Final Datasource configuration via XML (standalone-full.xml)

      Note the addition of <connection-property name="databaseName">myapp</connection-property>

      <subsystem xmlns="urn:jboss:domain:datasources:4.0">
      	<datasources>
      		<datasource jndi-name="java:/MY_APP_DS" pool-name="Postgres_MY_APP_DS">
      			<connection-url>jdbc:postgresql://localhost:5432/myapp</connection-url>
      			<connection-property name="databaseName">myapp</connection-property>
      			<driver>postgres</driver>
      			<security>
      				<user-name>myapp</user-name>
      				<password>myapp</password>
      			</security>
      			<validation>
      				<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
      				<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
      			</validation>
      		</datasource>
      		<drivers>
      			<driver name="postgres" module="org.postgres">
      				<driver-class>org.postgresql.Driver</driver-class>
      				<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
      				<datasource-class>org.postgresql.ds.PGSimpleDataSource</datasource-class>
      			</driver>
      		</drivers>
      	</datasources>
      </subsystem>
      

              rhn-engineering-lgao Lin Gao
              rhn-engineering-lgao Lin Gao
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: