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 deferred logging rather than System.out to report jars on the classpath with Class-Path manifest attributes that point to non-existent files when using DevTools #16883

Closed
TurtleBeach opened this issue May 16, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@TurtleBeach
Copy link

commented May 16, 2019

When I run a spring-boot application that depends on azure-spring-boot-starter (created by spring-initialzr), a message indicates various grpc jar files listed in the manifest for grpc-netty-shaded-1.14.0.jar do not exist. The manifest apparently expects all associated grpc jar files to be in the same folder as grpc-netty-shaded-1.14.0.jar (i.e., **…\io\grpc\grpc-netty-shaded\1.14.0**), yet in my local repository the associated jars each exist in separate folders under ...io/grpc (for example, the grpc-core jar is at …\io\grpc\grpc-core\1.14.0\grpc-core-1.14.0.jar).

The misconfiguration appears to have no impact on actually running the application, but it is disconcerting to see the message, and it is not clear under what circumstances things might break as I add more functionality to the application.
Jack

@wilkinsona

This comment has been minimized.

Copy link
Member

commented May 17, 2019

Thanks for the report. It's not clear what message you are referring to, but an educated guess is that you're using DevTools and the message is being output by this code:

System.out.println("The Class-Path manifest attribute in " + jarFile.getName()
+ " referenced one or more files that do not exist: "
+ StringUtils.collectionToCommaDelimitedString(nonExistentEntries));

Can you please provide some more information about the circumstances in which you are seeing the message?

@TurtleBeach

This comment has been minimized.

Copy link
Author

commented May 19, 2019

Yes, I did select DevTools when I created the spring-boot application using spring-initializr, at spring.io.
The message appears as the last line of a bunch of lines which appear in the Netbeans Output window right before the Spring ascii art and subsequent application startup logging information. (Running in Netbeans IDE 8.2).

The preceding line (truncated here) is:
Executing command line: C:\Program Files\Java\jdk1.8.0_181\bin\java.exe -classpath D:\spring-boot\runtime.demo\target\classes; . . .

To create the Netbeans project, I imported the zip file generated by spring-initializr into Netbeans, then let Netbeans get all the dependencies.
The message does not appear when I build a Jar file (using .mvnw command line outside of Netbeans).
Jack

@wilkinsona

This comment has been minimized.

Copy link
Member

commented May 23, 2019

Thanks. The problem really lies with the manifest of grpc-netty-shaded-1.14.0, the contents of which are out of Spring Boot's control. The message that's being output is a symptom of that problem. We can probably improve things a bit by switching from System.out to DevTools' deferred logging support at info level. We'll use this issue to do that.

@wilkinsona wilkinsona changed the title Incorrect references in grpc-netty-shaded-1.14.0.jar manifest Use deferred logging rather than System.out to inform the use of jars on the classpath with Class-Path manifest attributes that point to non-existent files when using DevTools May 23, 2019

@wilkinsona wilkinsona added this to the 2.2.x milestone May 23, 2019

@wilkinsona wilkinsona changed the title Use deferred logging rather than System.out to inform the use of jars on the classpath with Class-Path manifest attributes that point to non-existent files when using DevTools Use deferred logging rather than System.out to report jars on the classpath with Class-Path manifest attributes that point to non-existent files when using DevTools May 23, 2019

@wilkinsona wilkinsona modified the milestones: 2.2.x, 2.2.0.M4 May 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.