hibernate-orm
hibernate-orm copied to clipboard
HHH-13794 Fix ClassCast problem JAXBContext
- Use the current (XmlParserHelper) class's classloader to create the root JAXB context, so as to avoid a class cast problem with classes loaded on different classloaders due to jaxb defaulting to the current thread's context classloader.
- Add more information to the error message in case of a problem related to reading the persistence.xml (So that a non-parsing error also gets shown instead of "message: null").
Could someone have a look at this PR please?
This exactly solves my problem of using jpamodelgen with JDK 11
Is it possible to get this merged?
I was just looking into this, but it seems newer Maven and/or Java versions (11 update 9) are not affected anymore. At least I couldn't reproduce the error. Please continue the discussion on https://hibernate.atlassian.net/browse/HHH-13794
The problem still exists with Hibernate 6.3.1, JDK17, Maven 3.9.4, Maven Compiler Plugin 3.11.0. I created an up-to-date reproducer, see https://hibernate.atlassian.net/browse/HHH-13794?focusedCommentId=112967