4finance / micro-infra-spring

Repository containing default microservice infrastructure set up using Spring configuration
Apache License 2.0
203 stars 49 forks source link

spring-boot-starter-tomcat included transitively #328

Open ArturGajowy opened 9 years ago

ArturGajowy commented 9 years ago

Gradle dep insight:

org.apache.tomcat.embed:tomcat-embed-core:8.0.15
+--- org.apache.tomcat.embed:tomcat-embed-websocket:8.0.15
|    \--- org.springframework.boot:spring-boot-starter-tomcat:1.2.1.RELEASE
|         \--- org.springframework.boot:spring-boot-starter-web:1.2.1.RELEASE
|              \--- com.ofg:micro-infra-spring-base:0.8.10

Tomcat includes servlet-api classes in its org.apache.tomcat.embed:tomcat-embed-core:8.0.15 jar.

This causes the following error in my app, which does not use spring-boot and runs from embedded jetty.

java.lang.AbstractMethodError
at javax.servlet.http.HttpServletRequestWrapper.changeSessionId(HttpServletRequestWrapper.java:249)
at javax.servlet.http.HttpServletRequestWrapper.changeSessionId(HttpServletRequestWrapper.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
(...)

Suggested solution is to exclude spring-boot-starter-tomcat from micro-infra-spring exported dependencies. Probably this applies to all spring-boot starter jars included in it.

tadaskay commented 9 years ago

This should be fixed with #265 with all boot-starters as dependencies only in spring-boot related module