-
Notifications
You must be signed in to change notification settings - Fork 38.5k
DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl fails when run from a shaded jar [SPR-14246] #18819
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
Comments
Andy Wilkinson commented Reproduction: spring-attic/spring-framework-issues#127 |
Juergen Hoeller commented Hmm, so what should we be using instead if there is no such root URL? After all, we have to provide a non-null root URL to the JPA persistence provider... |
Andy Wilkinson commented Could this be a regression of the fix for #13474? |
Juergen Hoeller commented The jar URL handling code from #13474 is still present in |
Andy Wilkinson commented I just came to the same conclusion. I think the difference here is that there are no entities being scanned so we never go into the |
Andy Wilkinson commented In this particular case the user is providing an |
Juergen Hoeller commented Good idea... |
Juergen Hoeller commented We can resolve the persistence unit root from the orm.xml location now, if not set before. Please give it a try with a shaded jar... |
Andy Wilkinson commented Looks good, Juergen. Thanks for the fix. |
Andy Wilkinson opened SPR-14246 and commented
I'll open a PR with a sample that reproduces the problem. It boils down to a call to
ClassLoader.getResource("")
returningnull
when there are only jars on the classpath.The failure is:
This also affects an executable jar built by Spring Boot. We used to have a hack in Boot's custom class loader that worked around this issue, but that doesn't help people who are using shaded jars, and we would prefer not to have to reintroduce the hack.
Affects: 4.3 RC1
Reference URL: spring-projects/spring-boot#5842
Issue Links:
Referenced from: commits abfe3f2
1 votes, 7 watchers
The text was updated successfully, but these errors were encountered: