Description of problem: JBoss EAP 6.1 Final / STANDALONE mode When running a CLI script to create a datasource, the output is that "The batch executed successfully". However the database connection url is -1 in standalone.xml. This success response is misleading, since the correct values are not written in standalone.xml. So the issues are: 1) connection-url is not properly written in standalone.xml 2. success message is shown even if wrong values are written in standalone.xml Version-Release number of selected component (if applicable): JBoss EAP 6.1.Final How reproducible: Start JBoss EAP 6.1 Final Get the CLI script from https://github.com/aerogear/aerogear-unifiedpush-server/blob/0.8.1/h2-database-config.cli Execute jboss-eap-6.1/bin/jboss-cli.sh --file=./h2-database-config.cli Steps to Reproduce: 1. jboss-eap-6.1/bin/standalone.sh 2. jboss-eap-6.1/bin/jboss-cli.sh --file=./h2-database-config.cli 3. Check the standalone xml Actual results: connection-url for PushEEDS is -1 Expected results: connection-url for PushEEDS should be jdbc:h2:~/unifiedpush;DB_CLOSE_DELAY=-1 Additional info: When using double quotes: --connection-url="jdbc:h2:~/unifiedpush;DB_CLOSE_DELAY=-1" then the connection-url is properly written in standalone.xml If I use the jboss-cli.sh of JBoss AS 7.1.1 Final then the connection-url is properly written even without double quotes.
I'd like to add that the issue appears when using an equality sign inside the connection-url value. e.g: --connection-url=jdbc:h2:~/unifiedpush;DB_CLOSE_DELAY=-1
The equal sign is a special one, although in this position it could be argued that it should not be considered special. I'm gonna see what's going on there. To avoid issues with special characters you can escape or quote them. See the difference in the generated requests [standalone@localhost:9990 /] echo-dmr data-source add --name=myds --driver-name=h2 --jndi-name=java:/myds --connection-url=jdbc:h2:~/unifiedpush;DB_CLOSE_DELAY=-1 { "address" => [ ("subsystem" => "datasources"), ("data-source" => "myds") ], "operation" => "add", "jndi-name" => "java:/myds", "connection-url" => "-1", "driver-name" => "h2" } [standalone@localhost:9990 /] echo-dmr data-source add --name=myds --driver-name=h2 --jndi-name=java:/myds --connection-url=jdbc:h2:~/unifiedpush;DB_CLOSE_DELAY\=-1 { "address" => [ ("subsystem" => "datasources"), ("data-source" => "myds") ], "operation" => "add", "jndi-name" => "java:/myds", "connection-url" => "jdbc:h2:~/unifiedpush;DB_CLOSE_DELAY=-1", "driver-name" => "h2" } [standalone@localhost:9990 /] echo-dmr data-source add --name=myds --driver-name=h2 --jndi-name=java:/myds --connection-url="jdbc:h2:~/unifiedpush;DB_CLOSE_DELAY=-1" { "address" => [ ("subsystem" => "datasources"), ("data-source" => "myds") ], "operation" => "add", "jndi-name" => "java:/myds", "connection-url" => "jdbc:h2:~/unifiedpush;DB_CLOSE_DELAY=-1", "driver-name" => "h2" }
The equals sign in the value is treated as a name/value separator because the value parser is a general one, i.e. it can recognize all sorts of value types: - properties of the form name=value (which is how it recognizes the given value); - property lists: name=value(,name=value)*; - structures, such as {a=b,c=[d,e,f]}, etc; - etc. One way to avoid this issue is to rely on the parameter type defined in management model, i.e. connection-url is STRING, and use a simpler value parser. Potential problem with this approach is that, not sure how it is now, before the management model descriptions were not always accurate and STRING type could be used for parameters and properties that were in fact OBJECT, LIST, PROPERTY, etc.
Alexey Loubyansky <alex> updated the status of jira WFLY-2464 to Resolved
Alexey Loubyansky <alex> made a comment on jira WFLY-2464 Merged.
As in my previous comment, a simpler parser is used now for STRING types. As a consequence the equals sign does not have to be escaped in this case.