Problem migrating from ds.xml for cli

283 views
Skip to first unread message

frank.l...@outlook.de

unread,
Mar 15, 2022, 6:44:20 PM3/15/22
to WildFly
Hi,

I'm trying to migrate from the deprecated xml file based datasource definition to cli based, but executing
bash $JBOSS_HOME/bin/jboss-cli.sh --controller=sb2000:9990 --connect --user=... --password=... --file=/mbi/tmp/rwk2t-sb2000-ipc-ifx-ds.cli

gives me an error:
The batch failed with the following error (you are remaining in the batch editing mode to have a chance to correct the error):
WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:
Step: step-1
Operation: xa-data-source add  --name="rwk2t-sb2000-ipc"  --jndi-name="java:jboss/datasources/rwk2t-sb2000-ipc"  --use-java-context="true"  --spy="false"  --statistics-enabled="false"  --driver-name="ifxjdbc.jar"  --xa-datasource-class="com.informix.jdbcx.IfxXADataSource"  --user-name="..."  --password="..."  --same-rm-override="false"  --prepared-statements-cache-size="128"  --no-tx-separate-pool="true"  --background-validation="true"  --background-validation-millis="60000"  --check-valid-connection-sql="select 1 from sysmaster:sysdual"  --exception-sorter-class-name="org.jboss.jca.adapters.jdbc.extensions.informix.InformixExceptionSorter"
Failure: WFLYCTL0063: Composite operation was rolled back
Step: step-2
Operation: /subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc/xa-datasource-properties=ServerName:add(value="sb2000_net")
Failure: WFLYCTL0175: Resource [
    ("subsystem" => "datasources"),
    ("xa-data-source" => "rwk2t-sb2000-ipc")
] does not exist; a resource at address [
    ("subsystem" => "datasources"),
    ("xa-data-source" => "rwk2t-sb2000-ipc"),
    ("xa-datasource-properties" => "ServerName")
] cannot be created until all ancestor resources have been added


The currently used xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema">
  <xa-datasource jndi-name="java:jboss/datasources/res2l-sb2000-ipc" enabled="true" use-java-context="true" pool-name="res2l-sb2000-ipc" spy="false" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
    <driver>ifxjdbc.jar</driver>
    <xa-datasource-class>com.informix.jdbcx.IfxXADataSource</xa-datasource-class>
    <xa-datasource-property name="IfxIFXHOST">sb2000</xa-datasource-property>
    <xa-datasource-property name="PortNumber">9088</xa-datasource-property>
    <xa-datasource-property name="DatabaseName">res2l</xa-datasource-property>
    <xa-datasource-property name="ServerName">sb2000_net</xa-datasource-property>
    <xa-datasource-property name="IfxIFX_ISOLATION_LEVEL">2U</xa-datasource-property>
    <xa-datasource-property name="IfxIFX_LOCK_MODE_WAIT">26</xa-datasource-property>
    <xa-datasource-property name="IfxLOBCACHE">-1</xa-datasource-property>
    <xa-datasource-property name="IfxNEWCODESET">8859_15,8859-1,819</xa-datasource-property>
    <xa-datasource-property name="IfxDB_LOCALE">en_US.819</xa-datasource-property>
    <xa-pool>
      <is-same-rm-override>false</is-same-rm-override>
      <no-tx-separate-pools>true</no-tx-separate-pools>
    </xa-pool>
    <security>
      <user-name>...</user-name>
      <password>...</password>
    </security>
    <validation>
      <background-validation>true</background-validation>
      <background-validation-millis>60000</background-validation-millis>
      <check-valid-connection-sql>select 1 from sysmaster:sysdual</check-valid-connection-sql>
      <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.informix.InformixExceptionSorter"/>
    </validation>
    <statement>
      <prepared-statement-cache-size>128</prepared-statement-cache-size>
    </statement>
  </xa-datasource>
</datasources>


CLI file to replace the xml file above is
batch
xa-data-source add \
--name="rwk2t-sb2000-ipc" \
--jndi-name="java:jboss/datasources/rwk2t-sb2000-ipc" \
--use-java-context="true" \
--spy="false" \
--statistics-enabled="false" \
--driver-name="ifxjdbc.jar" \
--xa-datasource-class="com.informix.jdbcx.IfxXADataSource" \
--user-name="..." \
--password="..." \
--same-rm-override="false" \
--prepared-statements-cache-size="128" \
--no-tx-separate-pool="true" \
--background-validation="true" \
--background-validation-millis="60000" \
--check-valid-connection-sql="select 1 from sysmaster:sysdual" \
--exception-sorter-class-name="org.jboss.jca.adapters.jdbc.extensions.informix.InformixExceptionSorter"
/subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc/xa-datasource-properties=ServerName:add(value="sb2000_net")
/subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc/xa-datasource-properties=DatabaseName:add(value="rwk2t")
/subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc/xa-datasource-properties=IfxIFXHOST:add(value="sb2000")
/subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc/xa-datasource-properties=PortNumber:add(value="9088")
/subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc/xa-datasource-properties=IfxIFX_ISOLATION_LEVEL:add(value="2U")
/subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc/xa-datasource-properties=IfxIFX_LOCK_MODE_WAIT:add(value="26")
/subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc/xa-datasource-properties=IfxLOBCACHE:add(value="-1")
/subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc/xa-datasource-properties=IfxNEWCODESET:add(value="8859_15,8859-1,819")
/subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc/xa-datasource-properties=IfxDB_LOCALE:add(value="en_US.819")
xa-data-source enable --name="rwk2t-sb2000-ipc"
run-batch

Any obvious mistake in my cli file ?

Jean Francois Denise

unread,
Mar 16, 2022, 5:44:53 AM3/16/22
to wil...@googlegroups.com
Hi,
your cli file looks correct. Could you check the server log? I suspect that something went wrong when adding the datasource, logs could give more details (eg: missing driver).
Thank-you.
JF
--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/b256c1e0-4371-41e5-8280-b8492e830e02n%40googlegroups.com.


frank.l...@outlook.de

unread,
Mar 16, 2022, 10:32:55 AM3/16/22
to WildFly
Unfortunately nothing show up in server.log.

driver is there
15.03. 15:44:23,183 INFO  [org.jboss.as.server.deployment#start] WFLYSRV0027: Starting deployment of "ifxjdbc.jar" (runtime-name: "ifxjdbc.jar")
15.03. 15:44:53,178 INFO  [org.jboss.as.connector.deployers.jdbc#start] WFLYJCA0018: Started Driver service with driver-name = ifxjdbc.jar
15.03. 15:49:11,771 INFO  [org.jboss.as.server#handleResult] WFLYSRV0010: Deployed "ifxjdbc.jar" (runtime-name : "ifxjdbc.jar")

used with the same name in ds.xml file without problems.

I set log level for org.jboss.as to DEBUG and only got this output in server.log:
16.03. 15:27:16,640 DEBUG [org.jboss.as.domain.management#debugf] Identification of operation not progressing after [15000000000] ns has been requested
16.03. 15:27:26,642 DEBUG [org.jboss.as.domain.management#debugf] Identification of operation not progressing after [15000000000] ns has been requested
16.03. 15:27:36,636 DEBUG [org.jboss.as.domain.management#debugf] Identification of operation not progressing after [15000000000] ns has been requested
16.03. 15:27:46,644 DEBUG [org.jboss.as.domain.management#debugf] Identification of operation not progressing after [15000000000] ns has been requested
16.03. 15:27:56,656 DEBUG [org.jboss.as.domain.management#debugf] Identification of operation not progressing after [15000000000] ns has been requested
16.03. 15:28:04,247 DEBUG [org.jboss.as.controller.management-operation#executeStep] WFLYCTL0017: Operation ("add") failed - address: ([

    ("subsystem" => "datasources"),
    ("xa-data-source" => "rwk2t-sb2000-ipc"),
    ("xa-datasource-properties" => "ServerName")
]) - failure description: "WFLYCTL0175: Resource [

    (\"subsystem\" => \"datasources\"),
    (\"xa-data-source\" => \"rwk2t-sb2000-ipc\")
] does not exist; a resource at address [
    (\"subsystem\" => \"datasources\"),
    (\"xa-data-source\" => \"rwk2t-sb2000-ipc\"),
    (\"xa-datasource-properties\" => \"ServerName\")
] cannot be created until all ancestor resources have been added"
16.03. 15:28:06,864 DEBUG [org.jboss.as.domain.management#debugf] Identification of operation not progressing after [15000000000] ns has been requested

Nothing about failure during step-1. Following steps cannot succeed, when step-1 is not successful.

Jean Francois Denise

unread,
Mar 16, 2022, 12:08:13 PM3/16/22
to wil...@googlegroups.com
I found the problem,
remove the double quote in --name="rwk2t-sb2000-ipc" should be --name=rwk2t-sb2000-ipc
This value is used to compose the resource address: /subsystem=datasources/xa-data-source=rwk2t-sb2000-ipc
JF
Reply all
Reply to author
Forward
0 new messages