I figured this out but now I get an error when I try to add a custom attribute:
No Attribute found with name: test
I have the same problem, how did u figured it out?
You should probably not use the JBoss configuration file for your custom MBeans, at least not in development. If you have a 3.x.x release, look at server/default/deploy/user-service.xml. It shows how to configure your custom MBean. Just name your MBean service configuration file *-service.xml and drop it in your deploy directory, and your MBean will register itself. This doesn't solve your problem but will make your life easier during development - we leave our MBeans configuration files in the deploy directory.
Now to your specific problem. Have you defined the attribute in your interface and the setter and getter in your implementation?
requires that your interface has this:
public interface ObjectPoolLoaderMBean extends ServiceMBean
public void setPoolName(String name);
public String getPoolName();
and your MBean implementation contains this:
public class ObjectPoolLoader extends ServiceMBeanSupport implements ObjectPoolLoaderMBean, ObjectFactory
private String poolName;
public void setPoolName(String poolName)
this.poolName = poolName.trim();
public String getPoolName()
This is case sensitive. So your MBean would need settest defined in the interface and implemented. This is most likely your issue. I believe TheServerSide has a good MBean tutorial.
Hope that helps.
I forgot, my bad - for you to dynamically deploy this, your classes must be in a SAR so you must use a META-INF/jboss-service.xml. However, it does make things easier during development rather than stopping and starting JBoss all the time - which does get tedious.
I built all in one sar file.
The attribute is defined in the implementation and has getter and setter, and has getter and setter in the interface.
Why do I get the no attribute error