kennyk65 / Microservices-With-Spring-Student-Files

Student Files for Microservices with Spring course
308 stars 901 forks source link

Guide doesn't support java 11+ #30

Open iaroslav-vak opened 4 years ago

iaroslav-vak commented 4 years ago

I was unable to run lab4 guide with latest spring boot atm(2.2.1.RELEASE) and java 11. Even if I add jaxb dependencies here is the cause

...Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'traceFilterRegistration' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: Unsatisfied dependency expressed through method 'traceFilterRegistration' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.servlet.Filter' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value="httpTraceFilter")}...

After I downgrade spring boot to 2.1.10.RELEASE and added JAXB

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-core</artifactId>
      <version>2.3.0.1</version>
    </dependency>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.3.1</version>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>2.3.1</version>
    </dependency>

it worked out.