Early log entry for async EntityManagerFactory initialization failure

Closes gh-26093
This commit is contained in:
Juergen Hoeller 2020-11-13 17:52:51 +01:00
parent 500b54b86f
commit 0b580d194d
1 changed files with 4 additions and 1 deletions

View File

@ -418,10 +418,13 @@ public abstract class AbstractEntityManagerFactoryBean implements
String message = ex.getMessage();
String causeString = cause.toString();
if (!message.endsWith(causeString)) {
throw new PersistenceException(message + "; nested exception is " + causeString, cause);
ex = new PersistenceException(message + "; nested exception is " + causeString, cause);
}
}
}
if (logger.isErrorEnabled()) {
logger.error("Failed to initialize JPA EntityManagerFactory: " + ex.getMessage());
}
throw ex;
}