-
Notifications
You must be signed in to change notification settings - Fork 41k
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
Spring Boot 2.0.1 fails to start when web application uses spring-boot-starter-test #13047
Comments
Thanks for the report, but it's not clear from the information provided what the problem might be. A test-scoped dependency should have no effect at all on the classpath when you run your application so I don't understand why the exclusion you've shown should make any difference. To help us diagnose the problem, can you please provide a minimal sample that reproduces the problem along with details of exactly how you're attempting to start the application. |
+1, I have exact same issue. |
@wanghongfei a +1 without a sample is not helping. I've created a sample project with web and test (removing the If you want us to diagnose the problem you're experiencing, we need a sample that we can run ourselves. |
hi, I created a demo project that is able to reproduce this issue: This application is unable to start unless you uncomment specific code snippet in Sorry about the last useless comment |
Thanks for the sample. This is a duplicate of #12457. You need to exclude diff --git a/pom.xml b/pom.xml
index 6fa205d..e9743e8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,6 +36,12 @@
<groupId>org.hyperledger.fabric-sdk-java</groupId>
<artifactId>fabric-sdk-java</artifactId>
<version>1.1.0-alpha</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency> |
For the record, it's starting just fine, you just don't get any console log for the reason @wilkinsona mentioned. |
@snicoll Yes, I've noticed that. Thanks! |
I believe my issue was also related to a transitive dependency on commons-logging, but it was slightly different as I am not using fabric-sdk-java. The curious part to me is why excluding a test-scoped dependency made it work in spite of the existence of commons-logging... |
@beldenge My somewhat educated guess is that I was wrong when I said "a test-scoped dependency should have no effect at all on the classpath when you run your application " above and that the exclusion affected the ordering of the main class path. If you're sufficiently curious, you could verify that theory by comparing the classpath in the working and non-working cases. |
A Spring Boot 2.0.1 web application will not start if the spring-boot-starter-test dependency is included.
https://stackoverflow.com/questions/49917449/cannot-start-tomcat-server-when-having-spring-boot-starter-test-dependency-in/50157009#50157009
It seems to be related to the spring-core dependency within spring-boot-starter-test. If that specific dependency is excluded, then Spring Boot starts up fine.
The text was updated successfully, but these errors were encountered: