[jboss-jira] [JBoss JIRA] Commented: (JBADMCON-135) MBean attribute type java.util.Properties improperly handled when applying changes on page JMX MBean View
Geert Pante (JIRA)
jira-events at jboss.com
Wed Feb 7 11:21:30 EST 2007
[ http://jira.jboss.com/jira/browse/JBADMCON-135?page=comments#action_12352554 ]
Geert Pante commented on JBADMCON-135:
--------------------------------------
org.jboss.util.propertyeditor.PropertiesEditor does override the getValue to parse the input properties file format using java.util.Properties.load(InputStream is). It inherits setAsText(String text) from TextPropertyEditorSupport.
In the end, the default java.util.Properties.toString() method will be used in the getAsText() method, which results in "{name1=value1,name2=value2}".
It should use java.util.Properties.store(OutputStream os).
> MBean attribute type java.util.Properties improperly handled when applying changes on page JMX MBean View
> ---------------------------------------------------------------------------------------------------------
>
> Key: JBADMCON-135
> URL: http://jira.jboss.com/jira/browse/JBADMCON-135
> Project: JBoss Admin Console
> Issue Type: Bug
> Environment: JBoss 4.0.3, Windows XP Browser IE 6 and Firefox 1.5
> Reporter: Ben Hurwitz
>
> If you have an MBean attribute whose type is java.util.Properties (there is a built-in property editor for setting these in jboss-service.xml), applying changes to any attribute of that MBean is perilous. Its value is shown on the JMX MBean View form as {name1=value1, name2=value2, name3=value3} in an input field. That's not a bug for viewing the values, but the bug is that the style used for rendering values cannot be submitted to retain the attribute's value. If you don't change the Properties but simply click the "Apply Changes" button, the property values are now shown as {{name1=value1, name2=value2, name3=value3}}, and in fact what happened is that now there is a single property named "{name1" whose value is "value1, name2=value2, name3=value3}". Similarly, it is difficult to actively edit the field to obtain the property list you want.
> Workaround: It is possible to create the desired properly list by submitting the form twice: First set the property value to include "\r\n" and click "Apply Changes". This produces a new form showing an incorrect value for the properties, but with a multi-line text field for the Properties value. Now the correct properties values can be entered, one per line, like this:
> name1=value1
> name2=value2
> name3=value3
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list