AzureAD/azure-activedirectory-library-for-java

Adal4j dependency breaks Spring Boot app in Eclipse

pdyck opened this issue · 0 comments

pdyck commented

Hey,

when Adal4j is imported into my project, I can't run it in Eclipse STS because it breaks something in Spring:

2018-10-02 15:51:18,760 [WARN] [restartedMain] o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is java.lang.NoSuchFieldError: defaultReader

On StackOverflow I found some people having similar problems when using Microsoft Java libraries.

https://stackoverflow.com/questions/51558046/spring-boot-mockmvc-error-creating-bean
https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000702530-NoSuchFieldError-defaultReader-when-running-tests-in-IDEA

When I run gradlew bootRun on the command line it works.