Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl is unable to resolve root url in native image #29137

Closed
christophstrobl opened this issue Sep 12, 2022 · 1 comment
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@christophstrobl
Copy link
Member

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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 12, 2022
@sdeleuze sdeleuze self-assigned this Sep 12, 2022
@sdeleuze sdeleuze added in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 12, 2022
@sdeleuze sdeleuze added this to the 6.0.0-M6 milestone Sep 12, 2022
@jhoeller
Copy link
Contributor

jhoeller commented Sep 12, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants