User: starksm
Date: 01/12/27 22:14:26
Modified: src/main/org/jboss/jmx/server Tag: Branch_2_4
JMXAdaptorImpl.java
Log:
Catch all JMX exception in the invoke method and log the nested exception
at debug level.
Revision Changes Path
No revision
No revision
1.3.6.3 +24 -2 jboss/src/main/org/jboss/jmx/server/Attic/JMXAdaptorImpl.java
Index: JMXAdaptorImpl.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/jmx/server/Attic/JMXAdaptorImpl.java,v
retrieving revision 1.3.6.2
retrieving revision 1.3.6.3
diff -u -r1.3.6.2 -r1.3.6.3
--- JMXAdaptorImpl.java 2001/12/10 02:51:13 1.3.6.2
+++ JMXAdaptorImpl.java 2001/12/28 06:14:26 1.3.6.3
@@ -9,6 +9,7 @@
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;
+import java.rmi.ServerError;
import java.rmi.ServerException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -23,7 +24,9 @@
import javax.management.MBeanException;
import javax.management.MBeanServer;
import javax.management.ReflectionException;
+import javax.management.RuntimeErrorException;
import javax.management.RuntimeMBeanException;
+import javax.management.RuntimeOperationsException;
import javax.naming.InitialContext;
import org.jboss.jmx.interfaces.JMXAdaptor;
@@ -35,7 +38,7 @@
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
-* @version $Revision: 1.3.6.2 $
+* @version $Revision: 1.3.6.3 $
*/
public class JMXAdaptorImpl
extends UnicastRemoteObject
@@ -69,17 +72,36 @@
RemoteException
{
Object value = null;
+ Exception ex = null;
try
{
value = server.invoke(name, actionName, params, signature);
}
+ catch(MBeanException e)
+ {
+ ex = e.getTargetException();
+ }
+ catch(RuntimeErrorException e)
+ {
+ Error err = e.getTargetError();
+ ex = new ServerError("RuntimeErrorException", err);
+ }
catch(RuntimeMBeanException e)
+ {
+ ex = e.getTargetException();
+ }
+ catch(RuntimeOperationsException e)
{
- Exception ex = e.getTargetException();
+ ex = e.getTargetException();
+ }
+
+ if( ex != null )
+ {
String msg = "invoke name="+name+", action="+actionName+" failed";
log.debug(msg, ex);
throw new ServerException(msg, ex);
}
+
return value;
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development