diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dfbac9..93a8153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Improve `scan` action reliability (#62) * Refactor plugin system ([README](/plugins/README.md)) * IArgumentProvider now accepts an array of arguments instead of a string (a653e6367260ba46333e596d81da283a64fc80f1) +* Let `enum` action continue on RemoteObject retrieval errors ## v5.0.0 - Dec 23, 2023 diff --git a/src/eu/tneitzel/rmg/io/Formatter.java b/src/eu/tneitzel/rmg/io/Formatter.java index 75b6d22..4108f94 100644 --- a/src/eu/tneitzel/rmg/io/Formatter.java +++ b/src/eu/tneitzel/rmg/io/Formatter.java @@ -51,14 +51,17 @@ public void listBoundNames(RemoteObjectWrapper[] remoteObjects) for (RemoteObjectWrapper remoteObject : remoteObjects) { Logger.printlnMixedYellow("-", remoteObject.boundName); + Logger.increaseIndent(); if (remoteObject.remoteObject == null) { + Logger.printlnMixedRed("--> Error:", "RemoteObject could not be obtained from registry."); + Logger.printlnMixedBlue(" Check", "/docs/rmg/transport-errors.md", "for more information."); + + Logger.decreaseIndent(); continue; } - Logger.increaseIndent(); - if (remoteObject instanceof SpringRemotingWrapper) { Logger.printMixedBlue("-->", SpringRemotingWrapper.invocationHandlerClass, ""); diff --git a/src/eu/tneitzel/rmg/operations/Dispatcher.java b/src/eu/tneitzel/rmg/operations/Dispatcher.java index c450985..dcbf235 100644 --- a/src/eu/tneitzel/rmg/operations/Dispatcher.java +++ b/src/eu/tneitzel/rmg/operations/Dispatcher.java @@ -26,6 +26,7 @@ import eu.tneitzel.rmg.io.WordlistHandler; import eu.tneitzel.rmg.networking.RMIEndpoint; import eu.tneitzel.rmg.networking.RMIRegistryEndpoint; +import eu.tneitzel.rmg.utils.EmptyWrapper; import eu.tneitzel.rmg.utils.IUnknown; import eu.tneitzel.rmg.utils.RMGUtils; import eu.tneitzel.rmg.utils.RemoteObjectWrapper; @@ -113,36 +114,43 @@ private void obtainBoundObjects() throws NoSuchObjectException { ExceptionHandler.internalError("obtainBoundObjects", "reflection"); } - } else { - int retryCount = 0; - if (boundNames == null) { obtainBoundNames(); } - while (retryCount < 5) + remoteObjects = new RemoteObjectWrapper[boundNames.length]; + + outer: for (int ctr = 0; ctr < boundNames.length; ctr++) { - try - { - remoteObjects = getRegistry().lookupWrappers(boundNames); - return; - } + int retryCount = 0; - catch (java.rmi.UnmarshalException e) + while (retryCount < 5) { - retryCount += 1; - } + try + { + remoteObjects[ctr] = getRegistry().lookupWrapper(boundNames[ctr]); + continue outer; + } - catch (Exception e) - { - ExceptionHandler.unexpectedException(e, "lookup", "operation", true); + catch (java.rmi.UnmarshalException e) + { + retryCount += 1; + } + + catch (Exception e) + { + ExceptionHandler.unexpectedException(e, "lookup", "operation", true); + } } + + remoteObjects[ctr] = new EmptyWrapper(boundNames[ctr]); } + } }