Using Spring I can successfully register an mBean on WAS 6.0, and then
access it using wsadmin. On the WAS 6.1 the mbean seems to
instantiate, but I can't call/access/see the mbean using WebSphere's wsadmin command-line interface.
The Spring examples at http://static.springframework.org/sp...rence/jmx.html
work easily on WAS 6.0.
Using a basic interface:
package mysample.jmx;
public interface IJmxTestBean {
public int add(int x, int y);
public int getAge();
public void setAge(int age);
public void setName(String name);
public String getName();
}
And a basic class that implements this called JmxTestBean and the
following spring configuration successfully registers the mbean under
WAS 6.0, using this configuration (almost exactly the same as the Spring examples):
Using wsadmin and WAS 6.0 I can acess the mbean.Code:<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy- init="false"> <property name="beans"> <map> <entry key="bean:name=testBean1" value-ref="testBean"/> </map> </property> </bean> <bean id="testBean" class="mysample.jmx.JmxTestBean"> <property name="name" value="TEST"/> <property name="age" value="100"/> </bean>
First test to see if it is registered:
(1 means it's registered, 0 means it's not)Code:wsadmin>$AdminControl isRegistered "bean:name=testBean1" 1
Secondly, the attributes:
Following the same procedure on WAS 6.1 and it doesn't work!Code:wsadmin>$AdminControl getAttributes "bean:name=testBean1" {Name TEST} {Age 100}
Code:wsadmin>$AdminControl isRegistered "bean:name=testBean1" 0I don't see any errors in the logs, and I added some logging to theCode:wsadmin>$AdminControl getAttributes "bean:name=testBean1" WASX7015E: Exception running command: "$AdminControl getAttributes "bean:name=testBean1""; exception information: javax.management.InstanceNotFoundException: bean:name=testBean1
bean so I can see that is it being instantiated.
After reading this thread, I suspect that WAS is changing the name of the mbean, but any of the combinations I've tried have not worked. For example:
Any ideas? Has anyone successfully created and registered an mbean using Spring on WebSphere 6.1? Any one got any suggestions?Code:wsadmin>$AdminControl isRegistered "cell=myCellName,node=myNodeName,nodebean :name=testBean1" 0
I also posted the same question over on the WebSphere google group, I'll keep both updated if I get a solution.



Reply With Quote