NoSuchMethodError: XMLContext$Default.getDelimitedIdentifier() in EAP 6
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
- Hibernate
- 4.x
Issue
Encountering the following failure when migrating to EAP 6 from EAP 5
... JBWEB000287: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ".../META-INF/spring/integration-data.xml": Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.XMLContext$Default.getDelimitedIdentifier()Ljava/lang/Boolean;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE]
Resolution
- Update event listeners for compatibility with Hibernate 4
- Review Spring Hibernate 4 migration documentation
Root Cause
- The Spring code relies on Hibernate 3 but Hibernate 4 is shipped with EAP 6
- Use of Hibernate 3 in EAP 6 is unsupported
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
