Skip to content

Commit a5430d8

Browse files
tan9philwebb
authored andcommitted
Catch more general Hibernate 4.2 LinkageError
Update HibernateJpaAutoConfiguration to catch LinkageError rather than NoClassDefFoundError. Required due to the fact that JBoss EAP 6 wraps NoClassDefFoundErrors. Fixes gh-3605
1 parent b7e9f80 commit a5430d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ private void configureSpringJtaPlatform(Map<String, Object> vendorProperties,
147147
vendorProperties.put(JTA_PLATFORM, new SpringJtaPlatform(
148148
jtaTransactionManager));
149149
}
150-
catch (NoClassDefFoundError ex) {
151-
// Can happen if Hibernate 4.2 is used
150+
catch (LinkageError ex) {
151+
// NoClassDefFoundError can happen if Hibernate 4.2 is used and some
152+
// containers (e.g. JBoss EAP 6) wraps it in the superclass LinkageError
152153
if (!isUsingJndi()) {
153154
throw new IllegalStateException("Unable to set Hibernate JTA "
154155
+ "platform, are you using the correct "

0 commit comments

Comments
 (0)