[
https://issues.jboss.org/browse/WFLY-7018?page=com.atlassian.jira.plugin....
]
Mark S updated WFLY-7018:
-------------------------
Steps to Reproduce:
h3. The following Wildfly 10.0.0.Final Datasource configuration via CLI...
{code}
# 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
{code}
*... will produce the following exception in Wildfly 10.1.0.Final:*
{code}
{"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}
{code}
h3. The following Wildfly 10.0.0.Final Datasource configuration via XML
(standalone-full.xml)...
{code: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>
{code}
*... will produce the following Stacktrace on Wildfly 10.1.0.Final Application Server
Startup:*
{code}
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
}
{code}
h3. Other examples
The following configuration is similar and would also fail:
*
http://www.nailedtothex.org/roller/kyle/entry/registering-postgresql-jdbc...
was:
h3. The following Wildfly 10.0.0.Final Datasource configuration via CLI...
{code}
# 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
{code}
*... will produce the following exception in Wildfly 10.1.0.Final:*
{code}
{"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}
{code}
h3. The following Wildfly 10.0.0.Final Datasource configuration via XML
(standalone-full.xml)...
{code: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>
{code}
*... will produce the following Stacktrace on Wildfly 10.1.0.Final Application Server
Startup:*
{code}
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
}
{code}
h3. Other examples
The following configuration is similar and would also fail:
*
http://www.nailedtothex.org/roller/kyle/entry/registering-postgresql-jdbc...
*
http://www.ironjacamar.org/doc/userguide/1.2/en-US/html/apc.html#ex_datas...
Valid Wildfly 10.0.0.Final DataSource fails in Wildfly 10.1.0.Final
-------------------------------------------------------------------
Key: WFLY-7018
URL:
https://issues.jboss.org/browse/WFLY-7018
Project: WildFly
Issue Type: Bug
Components: JCA
Affects Versions: 10.1.0.Final
Reporter: Mark S
Assignee: Jesper Pedersen
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:
*
https://source.jboss.org/browse/IronJacamar/adapters/src/main/java/org/jb...
*
https://github.com/ironjacamar/ironjacamar/blob/ironjacamar-1.3.4.Final/a...
h3. The work-around
h3. Wildfly 10.1.0.Final Datasource configuration via CLI
{code}
# No parameter to set a connection property value.
{code}
h3. Wildfly 10.1.0.Final Datasource configuration via XML (standalone-full.xml)
Note the addition of {{<connection-property
name="databaseName">myapp</connection-property>}}
{code: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>
<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>
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)