]
Dimitris Andreadis reassigned JBAS-3859:
----------------------------------------
Assignee: Dimitris Andreadis (was: Scott M Stark)
Initialization of XMBean attributes doesn't occur
-------------------------------------------------
Key: JBAS-3859
URL:
http://jira.jboss.com/jira/browse/JBAS-3859
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: JMX
Affects Versions: JBossAS-4.0.3 SP1, JBossAS-4.0.5.GA
Environment: Windows XP, Mac OSX 10.4.8, Java 1.5.0_04, 1.6.0
Reporter: Chris
Assigned To: Dimitris Andreadis
The Wiki for initializing XMBean values upon deployment (see
http://wiki.jboss.org/wiki/Wiki.jsp?page=HowCanIInitializeXMBeanAttributes) suggests 2
ways to set the initial value. One is to use a <descriptor>, the other is to use a
plain <value> tag. This has been confirmed to be the way it should work by Dimitris
(see forum thread).
I have tried both ways on JBoss 4.0.3, 4.0.5, and JBoss 5.0.0 (JEE5_TCK) - using JDK1.5
and JDK 1.6, on XP and also on Mac .... and it does not set the initial value. Instead the
value is always the default value "I've got the devil inside me" which comes
from the String definition within the class file itself.
(Incidentally, as an aside, if you change the value in the JMX Console and restart JBoss,
then the value is correctly recovered from the persistence store).
To reproduce, open the file
$JBOSS_HOME\docs\examples\jmx\persistent-service.sar\META-INF\jboss-service.xml
and edit the file as per the Wiki's suggestion. e.g. for attribute SomeString add a
<value> tag as follows:
<attribute access="read-write" getMethod="getSomeString"
setMethod="setSomeString">
<name>SomeString</name>
<type>java.lang.String</type>
<value>This is my initial value</value> <!-- this line is new
-->
</attribute>
Copy this to the $JBOSS_HOME\server\default\deploy\ directory and start JBoss.
Then view the XMBean using the JMX console:
http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&nam...
You will see that the value for SomeString is "I've got the devil inside
me" from the class definition whereas I would expect it to be "This is my
initial value" as taken from the XML file.
(Incidentally, setting an MBean initial attribute does work, the persistence service
example has such a value for SomeElement:
"<some-message>Welcome to the Athens 2004, Olympic
Games!</some-message>"
But setting the XMBean initial attribute does not work)
(Also, if the attribute is changed to read-only then there is no error upon deployment to
show that the setting of the value has even been attempted.)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: