Fixed NPE error on connection problem;

This commit is contained in:
Oleg Agafonov 2019-03-08 15:11:06 +04:00
parent 697706748a
commit ba407dcdae

View file

@ -98,10 +98,12 @@ public class SessionImpl implements Session {
if (cause instanceof InvocationFailureException) {
InvocationFailureException exep = (InvocationFailureException) cause;
if (exep.getCause() instanceof IOException) {
if (exep.getCause().getMessage().startsWith("Field hash null is not available on current")
|| exep.getCause().getMessage().endsWith("end of file")) {
if ((exep.getCause().getMessage() != null) && (exep.getCause().getMessage().startsWith("Field hash null is not available on current")
|| exep.getCause().getMessage().endsWith("end of file"))) {
addMessage = "Probably the server version is not compatible with the client. ";
}
} else {
logger.error("Unknown server error", exep.getCause());
}
} else if (cause instanceof NoSuchMethodException) {
// NoSuchMethodException is thrown on an invocation of an unknow JBoss remoting