diff --git a/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool$Args.class b/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool$Args.class index b205b3a..104e170 100644 Binary files a/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool$Args.class and b/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool$Args.class differ diff --git a/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.class b/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.class index 5e969e7..8250d9a 100644 Binary files a/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.class and b/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.class differ diff --git a/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.jar b/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.jar index 86beb9f..dd1cbca 100644 Binary files a/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.jar and b/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.jar differ diff --git a/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.java b/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.java index bfc758d..2b70de9 100644 --- a/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.java +++ b/ZA.CoreService.ESBCertificateManager/Tools/SonicMfContainerTool.java @@ -15,7 +15,7 @@ import javax.management.ObjectName; public final class SonicMfContainerTool { public static final String TOOL_VERSION = - "2026-07-29-validate-restart"; + "2026-07-29-restart-empty-params"; public static void main(String[] args) { @@ -251,21 +251,32 @@ public final class SonicMfContainerTool info("ObjectName=" + objectName); StringBuffer attempts = new StringBuffer(); - String[] operations = new String[] + + // 1) restart (bevorzugt) + // 2) stop + start (Fallback; manche Agenten haben kein restart) + String[][] plans = new String[][] { - "stop", - "restart" + { "restart" }, + { "stop", "start" } }; - for (int index = 0; index < operations.length; index++) + for (int planIndex = 0; planIndex < plans.length; planIndex++) { - String operation = operations[index]; + String[] operations = plans[planIndex]; try { - info("Trying MBean.invoke(" + operation + ")"); - invokeNoArgs(connector, objectName, operation); - okRestart("MBean." + operation, shortName, domain); + for (int index = 0; index < operations.length; index++) + { + String operation = operations[index]; + info("Trying MBean.invoke(" + operation + ")"); + invokeNoArgs(connector, objectName, operation); + } + + okRestart( + "MBean." + joinOps(operations), + shortName, + domain); return; } catch (Throwable throwable) @@ -273,7 +284,7 @@ public final class SonicMfContainerTool Throwable root = rootOf(throwable); String line = "MBean." - + operation + + joinOps(operations) + " => " + root.getClass().getName() + ": " @@ -288,6 +299,23 @@ public final class SonicMfContainerTool "Neustart fehlgeschlagen:\n" + attempts.toString()); } + private static String joinOps(String[] operations) + { + StringBuffer buffer = new StringBuffer(); + + for (int index = 0; index < operations.length; index++) + { + if (index > 0) + { + buffer.append('+'); + } + + buffer.append(operations[index]); + } + + return buffer.toString(); + } + private static void invokeNoArgs( Object connector, ObjectName objectName, @@ -312,14 +340,18 @@ public final class SonicMfContainerTool "invoke(...) wurde nicht gefunden."); } + // Sonic JMSConnectorClient verlangt leere Arrays, nicht null. + Object[] params = new Object[0]; + String[] signature = new String[0]; + invokeMethod.invoke( connector, new Object[] { objectName, operation, - null, - null + params, + signature }); }