Bug 997584

Summary: Creating DMR objects sometimes throws IllegallArgumentException
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: CLIAssignee: jboss-set
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.1CC: brian.stansberry, cdewolf, chaowan, kkhan, myarboro
Target Milestone: DR1   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Kremensky 2013-08-15 16:47:03 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Petr Kremensky 2013-08-15 16:54:22 UTC
Sorry, I accidently submit bug while creating report. Never mind, here is description:

CLI throws IllegallArgumentException while parsing some (incorrect) commands. Here are examples:

[standalone@localhost:9999 /] cd subsystem=logging/periodic-rotating-file-handler
[standalone@localhost:9999 periodic-rotating-file-handler] TEST:add(suffix=".yyyy-MM-dd" file={path="test.log",relative-to="jboss.server.log.dir")})


[standalone@localhost:9999 /] cd subsystem=logging/periodic-rotating-file-handler=FILE
[standalone@localhost:9999 periodic-rotating-file-handler=FILE] :write-attribute(name=file, value={path"test.log", relative-to="jboss.server.log.dir"})

java.lang.IllegalArgumentException
	at org.jboss.dmr.ModelValue.getChild(ModelValue.java:108)
	at org.jboss.dmr.ModelNode.get(ModelNode.java:798)
	at org.jboss.as.cli.parsing.arguments.ArgumentValueCallbackHandler$DefaultValueState.addChild(ArgumentValueCallbackHandler.java:288)
	at org.jboss.as.cli.parsing.arguments.ArgumentValueCallbackHandler$DefaultValueState.complete(ArgumentValueCallbackHandler.java:241)
	at org.jboss.as.cli.parsing.arguments.ArgumentValueCallbackHandler.leavingState(ArgumentValueCallbackHandler.java:100)
	at org.jboss.as.cli.parsing.StateParser$ParsingContextImpl.leaveState(StateParser.java:114)
	at org.jboss.as.cli.parsing.GlobalCharacterHandlers$4.handle(GlobalCharacterHandlers.java:76)
	at org.jboss.as.cli.parsing.StateParser.parse(StateParser.java:68)
	at org.jboss.as.cli.parsing.StateParser.parse(StateParser.java:46)
	at org.jboss.as.cli.ArgumentValueConverter$1.fromString(ArgumentValueConverter.java:74)
	at org.jboss.as.cli.operation.impl.DefaultCallbackHandler.toOperationRequest(DefaultCallbackHandler.java:595)
	at org.jboss.as.cli.impl.CommandContextImpl.handle(CommandContextImpl.java:545)
	at org.jboss.as.cli.impl.CommandContextImpl.handleSafe(CommandContextImpl.java:598)
	at org.jboss.as.cli.impl.CommandContextImpl.interact(CommandContextImpl.java:1186)
	at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:259)
	at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.modules.Module.run(Module.java:270)
	at org.jboss.modules.Main.main(Main.java:411)

Comment 3 JBoss JIRA Server 2013-10-08 14:52:15 UTC
Alexey Loubyansky <alex> updated the status of jira WFLY-2204 to Resolved

Comment 4 JBoss JIRA Server 2013-10-08 14:52:15 UTC
Alexey Loubyansky <alex> made a comment on jira WFLY-2204

Fixed.

Comment 6 Petr Kremensky 2014-03-07 07:52:11 UTC
CLI session now don't crash, but IAE is still thrown, try:
bin]$ ./jboss-cli.sh -c "/subsystem=logging/periodic-rotating-file-handler=FILE:write-attribute(name=file, value={path"test.log", relative-to="jboss.server.log.dir"})"

Comment 7 Alexey Loubyansky 2014-03-07 11:19:09 UTC
What is the expected outcome?

Comment 8 Petr Kremensky 2014-03-07 11:49:16 UTC
I would expect something like:
{
    "outcome" => "failed",
    "failure-description" => "Failed to parse '{pathtest.log, relative-to=jboss.server.log.dir}'",
    "rolled-back" => true
}

or at least that exception is hidden from user.

Comment 9 Alexey Loubyansky 2014-03-07 12:10:59 UTC
Ok, I see the stacktrace logged, I'll clean it up.

It's a client side parsing which is failing. So, there won't be a DMR operation response.

Comment 10 JBoss JIRA Server 2014-03-20 10:42:58 UTC
Alexey Loubyansky <alex> updated the status of jira WFLY-3101 to Resolved

Comment 11 Joe Wertz 2014-07-01 10:12:56 UTC
Backported WFLY-3101

https://github.com/jbossas/jboss-eap/pull/1491

Comment 12 Petr Kremensky 2014-09-19 07:21:29 UTC
Verified on EAP 6.4.0.DR1.1

./jboss-cli.sh -c "/subsystem=logging/periodic-rotating-file-handler=FILE:write-attribute(name=file, value={path"test.log", relative-to="jboss.server.log.dir"})"
Failed to parse '{pathtest.log, relative-to=jboss.server.log.dir}': java.lang.IllegalArgumentException