Placeholder ##DEFAULT_DATASOURCE## is not replaced during the container startup process
Environment
- JBoss EAP for OpenShift Container Platform
- 7.3
Issue
If standalone-openshift.xml is brought from jboss-eap-7/eap71-openshift or jboss-eap-7/eap72-openshift to jboss-eap-7/eap73-openjdk8-openshift-rhel7, and even if the environment variable ENABLE_GENERATE_DEFAULT_DATASOURCE=true is set, then the following error occurs during starting the EAP7.3 container:
WARN You have set environment variables to configure the datasource in the default-bindings in the ee subsystem subsystem which conflicts with the value that already exists in the base configuration. The base configuration value will be used. Fix your configuration.
...
04:08:33,987 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "echo.war")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.module.echo.echo.env.##DEFAULT_DATASOURCE##"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.echo.echo.DefaultDataSource is missing [jboss.naming.context.java.module.echo.echo.env.##DEFAULT_DATASOURCE##]"]
}
In this error occurs, the place holder ##DEFAULT_DATASOURCE## is not replaced during starting up the EAP 7.3 container.
<default-bindings context-service="java:jboss/ee/concurrency/context/default"
datasource="##DEFAULT_DATASOURCE##" <<<===
jms-connection-factory="java:jboss/DefaultJMSConnectionFactory"
managed-executor-service="java:jboss/ee/concurrency/executor/default"
managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default"
managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
Resolution
This is known issue This content is not included.JBEAP-19167.
The workaround is to set the JNDI name of default data source instead of ##DEFAULT_DATASOURCE## as below:
@@ -172,7 +172,7 @@
</managed-scheduled-executor-services>
</concurrent>
<default-bindings context-service="java:jboss/ee/concurrency/context/default"
- datasource="##DEFAULT_DATASOURCE##"
+ datasource="java:jboss/datasources/ExampleDS"
jms-connection-factory="##DEFAULT_JMS##"
managed-executor-service="java:jboss/ee/concurrency/executor/default"
managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default"
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.