Bug 1026319 - [GSS] (6.4) Wrong datasource connection-url is written in standalone.xml even if CLI script executes successfully
[GSS] (6.4) Wrong datasource connection-url is written in standalone.xml even...
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CLI (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: DR1
: EAP 6.4.0
Assigned To: Alexey Loubyansky
Petr Kremensky
Depends On:
  Show dependency treegraph
Reported: 2013-11-04 07:15 EST by Tolis Emmanouilidis
Modified: 2017-10-09 20:21 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-2464 Major Resolved simpler (than OBJECT) parser for STRING parameters and properties 2016-07-10 22:56 EDT

  None (edit)
Description Tolis Emmanouilidis 2013-11-04 07:15:08 EST
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.
Comment 1 Tolis Emmanouilidis 2013-11-05 11:54:33 EST
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
Comment 2 Alexey Loubyansky 2013-11-07 08:52:41 EST
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"
Comment 3 Alexey Loubyansky 2013-11-07 10:16:14 EST
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.
Comment 4 JBoss JIRA Server 2013-11-14 06:47:33 EST
Alexey Loubyansky <alex@jboss.org> updated the status of jira WFLY-2464 to Resolved
Comment 5 JBoss JIRA Server 2013-11-14 06:47:33 EST
Alexey Loubyansky <alex@jboss.org> made a comment on jira WFLY-2464

Comment 6 Alexey Loubyansky 2013-11-14 06:51:09 EST
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.

Note You need to log in before you can comment on or make changes to this bug.