diff --git a/src/eu/tneitzel/rmg/operations/MethodGuesser.java b/src/eu/tneitzel/rmg/operations/MethodGuesser.java index 238677f..da4737f 100644 --- a/src/eu/tneitzel/rmg/operations/MethodGuesser.java +++ b/src/eu/tneitzel/rmg/operations/MethodGuesser.java @@ -440,6 +440,25 @@ public void run() } } + catch (java.rmi.UnmarshalException e) + { + /* + * When running with multiple threads, from time to time, stream corruption can be observed. + * This seems to be non deterministically and only appears in certain setups. In my current + * setup, it seems always to break on the "String selectSurname(String email)" method. In + * future, this should be debugged. However, as in a run of 3000 methods this only occurs one + * or two times, it is probably not that important. + */ + if (RMGOption.GLOBAL_VERBOSE.getBool()) + { + String info = "Caught unexpected " + e.getClass().getName() + " while guessing the " + candidate.getSignature() + "method.\n" + +"[-]" + Logger.getIndent() + "This occurs sometimes when guessing with multiple threads.\n" + +"[-]" + Logger.getIndent() + "You can retry with --threads 1 or just ignore the exception."; + Logger.eprintlnBlue(info); + ExceptionHandler.showStackTrace(e); + } + } + catch(Exception e) { /* @@ -449,11 +468,11 @@ public void run() e.printStackTrace(new PrintWriter(writer)); String info = "Caught unexpected " + e.getClass().getName() + " during method guessing.\n" - +"Please report this to improve rmg :)\n" - +"Stack-Trace:\n" + +"[-]" + Logger.getIndent() + "Please report this to improve rmg :)\n" + +"[-]" + Logger.getIndent() + "Stack-Trace:\n" +writer.toString(); - Logger.println(info); + Logger.eprintlnBlue(info); } finally @@ -557,6 +576,25 @@ public void run() */ } + else if (cause instanceof java.rmi.UnmarshalException) + { + /* + * When running with multiple threads, from time to time, stream corruption can be observed. + * This seems to be non deterministically and only appears in certain setups. In my current + * setup, it seems always to break on the "String selectSurname(String email)" method. In + * future, this should be debugged. However, as in a run of 3000 methods this only occurs one + * or two times, it is probably not that important. + */ + if (RMGOption.GLOBAL_VERBOSE.getBool()) + { + String info = "Caught unexpected " + e.getClass().getName() + " while guessing the " + SpringRemotingWrapper.getSignature(invocationHolder.getCandidate()) + " method.\n" + +"[-]" + Logger.getIndent() + "This occurs sometimes when guessing with multiple threads.\n" + +"[-]" + Logger.getIndent() + "You can retry with --threads 1 or just ignore the exception."; + Logger.eprintlnBlue(info); + ExceptionHandler.showStackTrace(e); + } + } + else { /* @@ -566,6 +604,25 @@ public void run() } } + catch (java.rmi.UnmarshalException e) + { + /* + * When running with multiple threads, from time to time, stream corruption can be observed. + * This seems to be non deterministically and only appears in certain setups. In my current + * setup, it seems always to break on the "String selectSurname(String email)" method. In + * future, this should be debugged. However, as in a run of 3000 methods this only occurs one + * or two times, it is probably not that important. + */ + if (RMGOption.GLOBAL_VERBOSE.getBool()) + { + String info = "Caught unexpected " + e.getClass().getName() + " while guessing the " + SpringRemotingWrapper.getSignature(invocationHolder.getCandidate()) + " method.\n" + +"[-]" + Logger.getIndent() + "This occurs sometimes when guessing with multiple threads.\n" + +"[-]" + Logger.getIndent() + "You can retry with --threads 1 or just ignore the exception."; + Logger.eprintlnBlue(info); + ExceptionHandler.showStackTrace(e); + } + } + catch(Exception e) { /* @@ -600,8 +657,8 @@ private void unexpectedError(RemoteInvocationHolder invoHolder, Exception e) e.printStackTrace(new PrintWriter(writer)); info = "Caught unexpected " + e.getClass().getName() + " during method guessing.\n" - +"Please report this to improve rmg :)\n" - +"Stack-Trace:\n" + +"[-]" + Logger.getIndent() + "Please report this to improve rmg :)\n" + +"[-]" + Logger.getIndent() + "Stack-Trace:\n" +writer.toString(); } @@ -610,7 +667,7 @@ private void unexpectedError(RemoteInvocationHolder invoHolder, Exception e) info = "Spring Remoting call did not cause an exception. This is not expected."; } - Logger.println(info); + Logger.eprintlnBlue(info); } } }