From ab686732d0702daf36b52d9e2c4e23b77511c7fa Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 24 Aug 2016 15:05:43 +0200 Subject: [PATCH] Refined exception message Issue: SPR-14609 --- .../transaction/interceptor/TransactionAspectSupport.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java index ff8faac6f18..f0c2b847833 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java @@ -240,9 +240,10 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init */ @Override public void afterPropertiesSet() { - if (getTransactionManager() == null && getBeanFactory() == null) { + if (getTransactionManager() == null && this.beanFactory == null) { throw new IllegalStateException( - "Setting the property 'transactionManager' or running in a BeanFactory is required"); + "Set the 'transactionManager' property or make sure to run within a BeanFactory " + + "containing a PlatformTransactionManager bean!"); } if (getTransactionAttributeSource() == null) { throw new IllegalStateException(