It may be true that I can't stop and restart James through JMX (although
I hope I can), but this issue is more basic than that. I am unable to
query any of the JMX services registered by James. I have just changed
my code to try to interrogate the SMTPServer MBean and it behaves the
same way. I can get a list of attributes for the bean, but when I try to
query their value this exception is thrown:

[Spool Thread #5] [20 Mar 2007 07:54:36,250] ProcessingAlert [FATAL] -
fatal unexpected error in SMTPProcessor:javax.management.MBeanException:
Operation isEnabled not in ModelMBeanInfo

So, with all of James' JMX MBeans I can see the attributes and
operations, but am unable to check the values/execute the operation.

FYI, here's the code I've been playing with to interrogate the
"Application" MBean:

MBeanServerConnection connection =
JMXUtil.getMBeanServerConnection("jmxrmi");
String objName = "Phoenix:application=james,topic=Application";

MBeanInfo info = connection.getMBeanInfo(new ObjectName(objName));
SPLogger.debug(XTConstants.MODULE_APPLICATION, "JMX Object: " +
info.getDescription());
for (MBeanOperationInfo oper : info.getOperations()) {
    SPLogger.debug(XTConstants.MODULE_APPLICATION, "Operation: " +
oper.getName());
}
for (MBeanAttributeInfo attr : info.getAttributes()) {
    SPLogger.debug(XTConstants.MODULE_APPLICATION, "Attribute: " +
attr.getName() + "Value: " + connection.getAttribute(new
ObjectName(objName), attr.getName()));
}

-----Original Message-----
From: Bernd Fondermann [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 19, 2007 6:49 PM
To: James Users List
Subject: Restarting James [Re: Exception while interacting with MBean]

Unfortunately, as far as I know, James cannot be restarted without
shutting down and restarting the JVM it runs in. To me, this does not
appear being a MBean-specific issue.

  Bernd

On 3/19/07, Scott Mitchell <[EMAIL PROTECTED]> wrote:
> Hello, thanks to a couple of list members help I have gotten James up
> and running w/the JMX connector started, and my retry logic working.
> However, I am now trying to interact with the published MBeans to
> attempt to programmatically stop/start the James process depending on
> the status of our backend system. Unfortunately I am getting
exceptions
> with any operation I attempt. Here are the error messages I get from
> JConsole when I attempt to view the
> "Phoenix:application=james,topic=Application" MBean. The list of
> attribute names comes up, but the values are all set to "Unavailable"
> and these exceptions are visible in the James console window:
>
>
>
> Mar 19, 2007 12:29:42 PM RequiredModelMBean getAttributes(String[])
>
> SEVERE: Failed to get "blockNames": javax.management.MBeanException:
> Operation getBlockNames not in ModelMBeanInfo
>
> Mar 19, 2007 12:29:42 PM RequiredModelMBean getAttributes(String[])
>
> SEVERE: Failed to get "description": javax.management.MBeanException:
> Operation getDescription not in ModelMBeanInfo
>
> Mar 19, 2007 12:29:42 PM RequiredModelMBean getAttributes(String[])
>
> SEVERE: Failed to get "displayName": javax.management.MBeanException:
> Operation getDisplayName not in ModelMBeanInfo
>
> Mar 19, 2007 12:29:42 PM RequiredModelMBean getAttributes(String[])
>
> SEVERE: Failed to get "homeDirectory":
javax.management.MBeanException:
> Operation getHomeDirectory not in ModelMBeanInfo
>
> Mar 19, 2007 12:29:42 PM RequiredModelMBean getAttributes(String[])
>
> SEVERE: Failed to get "name": javax.management.MBeanException:
Operation
> getName not in ModelMBeanInfo
>
> Mar 19, 2007 12:29:42 PM RequiredModelMBean getAttributes(String[])
>
> SEVERE: Failed to get "running": javax.management.MBeanException:
> Operation isRunning not in ModelMBeanInfo
>
>
>
> I have also tried similar things in code but I get the same "Operation
> isRunning not in ModelMBeanInfo" exception there are well. Has anyone
> seen this before?
>
>
>
> Thanks,
>
> Scott
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to