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

Use the same classpath ordering for an exploded war and an archive #19875

Closed
wilkinsona opened this issue Jan 23, 2020 · 4 comments
Closed

Use the same classpath ordering for an exploded war and an archive #19875

wilkinsona opened this issue Jan 23, 2020 · 4 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

This is a follow on from #9128 to consider whether or not we want the same functionality for war files.

@wilkinsona wilkinsona added for: team-attention An issue we'd like other members of the team to review type: enhancement A general enhancement labels Jan 23, 2020
@wilkinsona wilkinsona added this to the 2.3.x milestone Jan 23, 2020
@wilkinsona wilkinsona removed the for: team-attention An issue we'd like other members of the team to review label Jan 29, 2020
@wilkinsona wilkinsona modified the milestones: 2.3.x, 2.x Jan 29, 2020
@stategen
Copy link

stategen commented Feb 3, 2021

Yes, I have the same problem with springboot-2.3. x. when I rewrite class with the same name and package, I get new class when I test in eclipse. But when it packaged and run , spring boot loads the class in dependence jar and ignores new class, even though it is in WEB-INF/classes folder.

I think it should be compatible with the order of tomcat's classloader, because most of the old projects were originally running in tomcat or orther java container, otherwise upgrading to spring boot will bring bugs that are difficult to test

@wilkinsona
Copy link
Member Author

@stategen How are you running your application? This issue is only relevant if you are unzipping a war file and then running it with something like java -cp . org.springframework.boot.loader.WarLauncher. When a war file is run using java -jar, classes in WEB-INF/classes should already be preferred over classes in the jars in WEB-INF/lib. If you're using java -jar and that's not happening then please open a new issue with a minimal sample that reproduces the problem.

@scottfrederick
Copy link
Contributor

The Paketo Spring Boot buildpack expects a classpath index file in a jar or war when building a native image in order to get a predictable classpath at native image build time. The absence of a classpath index in a war file currently causes an error in the buildpack. It would be good for the buildpack to be able to treat jar and war files consistently, so this enhancement would be beneficial.

@scottfrederick scottfrederick added the for: team-attention An issue we'd like other members of the team to review label Dec 2, 2021
@scottfrederick scottfrederick self-assigned this Dec 2, 2021
@wilkinsona
Copy link
Member Author

Given the above, this sounds like a good thing to address in 2.7.

@scottfrederick scottfrederick modified the milestones: 2.x, 2.7.x Dec 7, 2021
@scottfrederick scottfrederick removed the for: team-attention An issue we'd like other members of the team to review label Dec 7, 2021
@scottfrederick scottfrederick modified the milestones: 2.7.x, 2.7.0-M1 Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants