Skip to content

Commit ab68673

Browse files
committed
Refined exception message
Issue: SPR-14609
1 parent 6d86437 commit ab68673

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,10 @@ protected final BeanFactory getBeanFactory() {
240240
*/
241241
@Override
242242
public void afterPropertiesSet() {
243-
if (getTransactionManager() == null && getBeanFactory() == null) {
243+
if (getTransactionManager() == null && this.beanFactory == null) {
244244
throw new IllegalStateException(
245-
"Setting the property 'transactionManager' or running in a BeanFactory is required");
245+
"Set the 'transactionManager' property or make sure to run within a BeanFactory " +
246+
"containing a PlatformTransactionManager bean!");
246247
}
247248
if (getTransactionAttributeSource() == null) {
248249
throw new IllegalStateException(

0 commit comments

Comments
 (0)