You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spring Boot 2.0.1 fails to start when web application uses spring-boot-starter-test #13047
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.
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.
@wanghongfei a +1 without a sample is not helping. I've created a sample project with web and test (removing the test scope for the latter) and the app starts just fine as @wilkinsona indicated above.
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: https://github.com/wanghongfei/springboot-issue-demo
This application is unable to start unless you uncomment specific code snippet in pom.xml which excluding the spring-core dependency.
Thanks for the sample. This is a duplicate of #12457.
You need to exclude commons-logging:common-logging which is currently being pulled in as a transitive dependency of org.hyperledger.fabric-sdk-java:fabric-sdk-java. You can do so by updating your pom like this:
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.
Activity
wilkinsona commentedon May 3, 2018
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.
wanghongfei commentedon May 4, 2018
+1, I have exact same issue.
snicoll commentedon May 4, 2018
@wanghongfei a +1 without a sample is not helping. I've created a sample project with web and test (removing the
testscope for the latter) and the app starts just fine as @wilkinsona indicated above.If you want us to diagnose the problem you're experiencing, we need a sample that we can run ourselves.
wanghongfei commentedon May 4, 2018
hi, I created a demo project that is able to reproduce this issue:
https://github.com/wanghongfei/springboot-issue-demoThis application is unable to start unless you uncomment specific code snippet in
pom.xmlwhich excluding thespring-coredependency.Sorry about the last useless comment
wilkinsona commentedon May 4, 2018
Thanks for the sample. This is a duplicate of #12457.
You need to exclude
commons-logging:common-loggingwhich is currently being pulled in as a transitive dependency oforg.hyperledger.fabric-sdk-java:fabric-sdk-java. You can do so by updating your pom like this:snicoll commentedon May 4, 2018
For the record, it's starting just fine, you just don't get any console log for the reason @wilkinsona mentioned.
wanghongfei commentedon May 4, 2018
@snicoll Yes, I've noticed that. Thanks!
beldenge commentedon May 4, 2018
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...
wilkinsona commentedon May 4, 2018
@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.