|
I've a application which is using JPA to perform database operations and has its own persistence.xml with unit-name as "myappunit". This application is dependent on a 3rd party library that too has persistence.xml but with jta-data-source as it can be deployed within a container. Now issue is, while trying to create an instance entity manager factory for unit-name "myappunit", I'm getting.
First of all, the above error message is very ambigious, as it is not telling for with persistence.xml the exception is thrown. One need to enable trace level logs of hibernate to figure out for which persistece.xml the exception is thrown.
Upon further debugging and enabling logs I found that in doResolve of PersistenceXmlParser, if validation of even one persistence.xml fails, the complete process of creation of entity manger gets beak.
I think the logic should continue with rest of persistence.xml's and the proper exception handling should be there along with logging.
The current code for doResolve in PersistenceXmlParser is
It would be nice if it will be modified as
|