|
Using MetadataSources.addCacheableFile with a .hbm.xml file that exists but without a .hbm.xml.bin file (not created yet at this point) results in a null binding because of https://github.com/hibernate/hibernate-orm/blob/5.0.1.Final/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/CacheableFileXmlSource.java#L98. In the end it results in a NPE:
Instead, I think that the binding should be returned after having been serialized (now the .hbm.xml.bin file exists). That is, "return binding" after https://github.com/hibernate/hibernate-orm/blob/5.0.1.Final/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/CacheableFileXmlSource.java#L95.
I have attached a patch that seems to fix the problem for me.
|