ewolff / microservice

Sample of a Microservice setup for my book. Based on Spring Cloud / Netflix / Java / Docker / Docker Compose / Docker Machine / Vagrant
Apache License 2.0
725 stars 352 forks source link

Eureka Tests fail with Java 9 #20

Closed chaitan64arun closed 6 years ago

chaitan64arun commented 7 years ago

Any new members using Java 9 to test this project, you might encounter test failures like below.

org.springframework.web.client.HttpClientErrorException: 404 null
    at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91)
    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:700)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:653)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:613)
    at org.springframework.web.client.RestTemplate.getForEntity(RestTemplate.java:312)
    at com.ewolff.microservice.eurekaserver.ApplicationTests.catalogLoads(ApplicationTests.java:25)

The root cause is java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present. Refer Java 9 explanationhere

So just down grade your JDK to work until there is a fix available.

ewolff commented 7 years ago

Thanks for pointing this out!

emazzotta commented 6 years ago

This fixed it for me: https://stackoverflow.com/a/48136912/2596187

ewolff commented 6 years ago

Thanks! I fixed it with 5a74df2f1620e9998adf8c741c0059b8f5569bdd .