Closed hongminzhu closed 5 years ago
This seems to be a Windows specific issue. I wasn't able to reproduce the error on macOS.
@chyt Might be a good time to look into testing with Windows on Travis again.
I see two issues here:
Boost seems to be only looking at compile dependencies, not implementation in order to decide to generate our Liberty servlet-4.0 feature. So for something like: implementation 'org.springframework.boot:spring-boot-starter-web'
we wouldn't bother to generate the feature in the Liberty config, and so Tomcat gets started.
The behavior seems to have changed moving from SpringBoot 2.0.4 to SpringBoot 2.1.2. In 2.0.4 I get a straightforward message:
00:01:38.359 [Default Executor-thread-8] ERROR org.springframework.boot.SpringApplication - Application run failed com.ibm.ws.app.manager.springboot.container.ApplicationError: CWWKC0254E: The application failed to start because it requires a servlet feature to be configured in the server.xml file.
But in 2.1.2 we see the error within the Tomcat container:
Caused by: java.lang.Error: factory already defined at java.net.URL.setURLStreamHandlerFactory(URL.java:1112) ~[na:1.8.0_191]
Also, I don't see this as a Windows issue. I see the same exact thing with an 'implementation' dependency on Windows (using Gradle 4.4.1 if it matters) and Linux using the gradlew
wrapper.
I opened an issue in open-liberty https://github.com/OpenLiberty/open-liberty/issues/6360 This issue will be fixed in the next release.
@anjumfatima90 sounds like the open-liberty #6360 covers the difference btw. the symptom in 2.0.4 vs 2.1.2... (thanks for pointing that out too). However I think boost gradle still has the same underlying problem of not generating the servlet-4.0
feature. @mattbsox do you agree?
Yup, I can look into that. Might just need to broaden the scope we're searching to include those extra configurations.
The spring boot library cache for the demo application unexpectedly contains dependency jar "spring-boot-starter-tomcat-2.1.2.RELEASE.jar and all the related tomcat runtime jars. I assume the pom declares a dependency on spring boot starter v2.1.x. Currently the springBoot utility and server runtimes filter-out (i.e. thin) dependency jars for starter versions 1.5.x and 2.0.x. I can reproduce the unexpected thinning behavior using a sample application on both windows and macOS. I'll discuss this finding with @tjwatson and @anjumfatima90 as I see a few solutions to consider (ref: https://github.com/OpenLiberty/open-liberty/issues/6360.)
Hello. The update to open-liberty to thin (filter-out) SpringBoot embedded server dependencies, OpenLiberty/open-liberty#6360, has merged into open-liberty 19.0.0.2. Let's verify the update within the Boost gradle plugin.
Took a look on Mac and Windows. Worked as expected with OL 19.0.0.2 and the latest version of boost-gradle built from master.
@mattbsox, @hongminzhu - Any objection to closing this now?
Nope, I'll close it now.
Hi there,
I created a fresh spring boot app with spring initializr, and built the boost-gradle-plugin locally. Here is my build.gradle
After running
gradle boostPackage
, I expected the app to "just run", however I'm getting the following errors:It seems like the tomcat dependencies are not being excluded properly.