diff --git a/bindings/java/org/collectd/java/GenericJMX.java b/bindings/java/org/collectd/java/GenericJMX.java
index 978e989baed0487a121be5f70e399f4ec7d95f71..319615c96ff43752a44d6ac985bed8b903832756 100644 (file)
public int read () /* {{{ */
{
for (int i = 0; i < this._connections.size (); i++)
- this._connections.get (i).query ();
+ {
+ try
+ {
+ this._connections.get (i).query ();
+ }
+ catch (Exception e)
+ {
+ Collectd.logError ("GenericJMX: Caught unexpected exception: " + e);
+ e.printStackTrace ();
+ }
+ }
return (0);
} /* }}} int read */