Browse Source

Ignore null message when introspecting resource cleanup failure

Closes gh-30597
pull/30619/head
Juergen Hoeller 3 years ago
parent
commit
c052a02592
  1. 9
      spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java

9
spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java

@ -1067,10 +1067,11 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
* @param ex the throwable to try to unwrap * @param ex the throwable to try to unwrap
*/ */
private Throwable unwrapIfResourceCleanupFailure(Throwable ex) { private Throwable unwrapIfResourceCleanupFailure(Throwable ex) {
if (ex instanceof RuntimeException && if (ex instanceof RuntimeException && ex.getCause() != null) {
ex.getCause() != null && String msg = ex.getMessage();
ex.getMessage().startsWith("Async resource cleanup failed")) { if (msg != null && msg.startsWith("Async resource cleanup failed")) {
return ex.getCause(); return ex.getCause();
}
} }
return ex; return ex;
} }

Loading…
Cancel
Save