Bug 1040828 - CLI: Certain command line batch operations doesn't work on Windows
Summary: CLI: Certain command line batch operations doesn't work on Windows
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CLI
Version: 6.2.0
Hardware: Unspecified
OS: Windows
unspecified
medium
Target Milestone: ---
: EAP 6.3.0
Assignee: Alexey Loubyansky
QA Contact: Petr Kremensky
Russell Dickenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-12 08:08 UTC by Michal Karm Babacek
Modified: 2014-06-29 22:03 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-07 16:04:26 UTC
Type: Bug


Attachments (Terms of Use)

Description Michal Karm Babacek 2013-12-12 08:08:52 UTC
Hi guys, these operations work splendidly with jboss-cli.sh:

{code}
./jboss-cli.sh --connect --commands='/extension=org.jboss.as.modcluster:add()' --timeout=12000
./jboss-cli.sh --connect --commands='/subsystem=web/connector=ajp:add(name=ajp,protocol=ajp,scheme=ajp,socket-binding=ajp)' --timeout=120000
./jboss-cli.sh --connect --commands='batch,/:composite(steps=[{"operation"=>"add","address"=>[("subsystem"=>"modcluster")]},{"operation"=>"add","address"=>[("subsystem"=>"modcluster"),("mod-cluster-config"=>"configuration")],"connector"=>"ajp","balancer"=>"qacluster","advertise"=>"true","advertise-socket"=>"modcluster"},{"operation"=>"add","address"=>[("socket-binding-group"=>"standard-sockets"),("socket-binding"=>"modcluster")],"port"=>0,"multicast-address"=>"224.0.5.213","multicast-port"=>"23364"}]),run-batch' --timeout=120000
{code}

whereas on Windows, these first two pass:

{code}
jboss-cli.bat --connect --commands=/extension=org.jboss.as.modcluster:add() --timeout=12000
jboss-cli.bat --connect --commands=/subsystem=web/connector=ajp:add(name=ajp,protocol=ajp,scheme=ajp,socket-binding=ajp) --timeout=120000
{code}

and this last one just hangs in cmd and terminates on hitting Return, leaving no output, no error message, nothing.

{code}
jboss-cli.bat --connect --commands=batch,/:composite(steps=[{"operation"=>"add","address"=>[("subsystem"=>"modcluster")]},{"operation"=>"add","address"=>[("subsystem"=>"modcluster"),("mod-cluster-config"=>"configuration")],"connector"=>"ajp","balancer"=>"qacluster","advertise"=>"true","advertise-socket"=>"modcluster"},{"operation"=>"add","address"=>[("socket-binding-group"=>"standard-sockets"),("socket-binding"=>"modcluster")],"port"=>0,"multicast-address"=>"224.0.5.213","multicast-port"=>"23364"}]),run-batch --timeout=120000
{code}

I tried to escape ' " ' and ' , ' with both ^ and \ and it didn't help. I also tried to swap " with ', no luck either. As you might see, I omitted all the spaces as well and again, it didn't bring any improvement.

I admit my knowledge of Windows and Batch is rather limited, so it's possible that someone might know how to make jboss-cli.bat swallow this batch operation of mine. THX for comments.

Comment 1 Alexey Loubyansky 2014-01-07 16:04:26 UTC
This is windows command line specific. The correct syntax would be to escape and quote all the special characters, e.g. the line would start as:

jboss-cli.bat --connect --commands=batch,/:composite(steps=[{\"operation\"=">"\"add\"...

And so on.

'>' character is treated as outout redirection which explains why there is no output on the terminal.

The other thing is, I don't know whether that is intentional, but using composite inside a batch doesn't make any sense. It simply further and unnecessary complicates the line. Since that is what the batch is all about - to create a single composite operation out of the commands and operations included into the batch.


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