org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [gts.efx.web.login.LogInController]: Constructor threw exception; nested exception is java.lang.LinkageError: loader constraint violation: when resolving method "javax.net.ssl.SSLContext.getSocketFactory()Ljavax/net/ssl/SSLSocketFactory;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/apache/http/conn/ssl/SSLConnectionSocketFactory, and the class loader (instance of ) for resolved class, javax/net/ssl/SSLContext, have different Class objects for the type javax/net/ssl/SSLSocketFactory used in the signature
This error comes up after adding the dependency
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
If i don't add this dependency i get
java.lang.NoClassDefFoundError: org/apache/http/conn/HttpClientConnectionManager
at gts.efx.web.login.LogInController.<init>(LogInController.java:51)
Any help ? Thanks in advance.