Skip to content

When a package is split across multiple locations, LaunchedURLClassLoader may use the "wrong" manifest #5485

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

Closed
wilkinsona opened this issue Mar 24, 2016 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@wilkinsona
Copy link
Member

When LaunchedURLClassLoader loads a class, it preemptively defines the class's package. This ensures that a manifest in a nested jar is found and associated with the package. If the package is split across multiple locations, LaunchedURLClassLoader will currently use the manifest from the first location that it finds for the package. This can lead to a manifest from a location other than that of the class that triggered the package definition being used which is undesirable.

A notable example of the problem is the loader code which contains an empty org.springframework.boot package (as it's the parent of the org.springframework.loader package). It's repackaged into the root of the application jar and we don't want the application's manifest to be used for the org.springframework.boot package.

We need to ensure that the manifest from a jar that actually contains an org.springframework.boot class is used instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant