Bootstrapping the DefaultPersistenceUnitManager
fails in native image being unable to resolve the root url. Replacing determineDefaultPersistenceUnitRootUrl
via a substitution that returns null
allowed to initialize the PersistenceUnitManager
.
See: pring-aot-smoke-tests#113
Comment From: jhoeller
I guess it would also help to call setDefaultPersistenceUnitRootLocation(null)
since the implementation already has that escape hatch? We should make the default implementation more defensive though, there is no need to fail hard, at least not with the ORIGINAL_DEFAULT_PERSISTENCE_UNIT_ROOT_LOCATION
as input. This could be as straightforward as just logging the "Unable to resolve persistence unit root URL" message and returning null
instead of throwing a PersistenceException
there, potentially with an if
check to only perform such a lenient return in case of defaultPersistenceUnitRootLocation == ORIGINAL_DEFAULT_PERSISTENCE_UNIT_ROOT_LOCATION
.