Bug #47877 Stack trace when trying to create a rule without a version
Submitted: 6 Oct 2009 21:19 Modified: 1 Mar 2010 13:28
Reporter: Mark Leith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Web Severity:S3 (Non-critical)
Version:2.1.0 OS:Any
Assigned to: Josh Sled CPU Architecture:Any

[6 Oct 2009 21:19] Mark Leith
Description:
Creating a new rule, without providing a version, leads to the following stacktrace:

For input string: ""
java.lang.NumberFormatException.forInputString(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
com.mysql.util.Version.<init>(Version.java:77)
com.mysql.merlin.ui.actions.monitor.advisors.SaveRule.exec(SaveRule.java:408)
com.mysql.merlin.ui.actions.BaseAction$1.call(BaseAction.java:1915)
com.mysql.merlin.ui.actions.BaseAction$1.call(BaseAction.java:1914)
com.mysql.merlin.ui.actions.BaseAction.execute(BaseAction.java:1898)
com.mysql.merlin.ui.actions.BaseAction.execute(BaseAction.java:1913)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
...

How to repeat:
o Navigate to CreateRule.action
o Create a rule with a name, expression, variables, threshold etc. - but do not supply a version

Suggested fix:
Default to 1.0 if not supplied?
[7 Oct 2009 19:41] Enterprise Tools JIRA Robot
Gary Whizin writes: 
Suggestion: creating a new rule should also populate Version by default
[9 Feb 2010 16:54] Enterprise Tools JIRA Robot
Josh Sled writes: 
Note this is only fixed in 2.2 (trunk), not 2.1.

revno: 7883
revision-id: jsled@asynchronous.org-20100209162409-z5918kae0ecxptep
parent: oldag@mysql.com-20100208195209-3mz9va1gqcbbaems
committer: Josh Sled <jsled@asynchronous.org>
branch nick: local
timestamp: Tue 2010-02-09 11:24:09 -0500
message:
  EM-3632: validate the version field on rule editing.

also:

revno: 7884
revision-id: jsled@asynchronous.org-20100209164913-o34lw86xh3z94lwp
parent: jsled@asynchronous.org-20100209162409-z5918kae0ecxptep
committer: Josh Sled <jsled@asynchronous.org>
branch nick: local
timestamp: Tue 2010-02-09 11:49:13 -0500
message:
  Add default Version for new rules to make life easier for our users.
[10 Feb 2010 19:10] Enterprise Tools JIRA Robot
Keith Russell writes: 
Patch installed in versions => 2.2.0.1614.
[10 Feb 2010 19:39] Enterprise Tools JIRA Robot
Keith Russell writes: 
Last AIB comment should say, patch installed in versions => 2.2.0.1616
[11 Feb 2010 17:52] Enterprise Tools JIRA Robot
Marcos Palacios writes: 
Verified fixed in Monitor build 2.2.0.1616.
[1 Mar 2010 13:28] MC Brown
Added a note to the 2.2.0 changelog, and I've updated the rule creation content to explain that a default version is added if you don't specify one.