Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,22 @@ protected synchronized void setup() throws Exception {
handler.setup();
handlers.add(handler);
} catch (Exception e) {
logger.trace("Failed to setup session {} for activation {}", i, spec, e);
if (cf != null) {
if (!spec.isSingleConnection()) {
cf.close();
}
cf.close();
}
if (session != null) {
session.close();
}
if (firstException == null) {
firstException = e;
}
if (spec.isSingleConnection()) {
// The shared ClientSessionFactory is in a broken state; stop the loop
// all remaining sessions would fail with "ClientSession closed while
// creating session", masking the real error.
break;
}
}
}
//if we have any exceptions close all the handlers and throw the first exception.
Expand Down