[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16839193#comment-16839193
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1988:
-----------------------------------------------

[~striderapache] I am not sure I understand what this class loader issue has to 
do with HttpClient.

Oleg

> The chosen LogFactory implementation does not extend LogFactory.
> ----------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1988
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1988
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (classic)
>    Affects Versions: 4.5.2
>            Reporter: dennis lucero
>            Priority: Blocker
>
>  
> org.springframework.beans.BeanInstantiationException: Failed to instantiate  
> Factory method 'myXXXApi' threw exception; nested exception is 
> org.apache.commons.logging
> {code:java}
> Caused by: org.apache.commons.logging.LogConfigurationException: The chosen 
> LogFactory implementation does not extend LogFactory. Please check your 
> configuration. (Caused by java.lang.ClassCastException: The application has 
> specified that a custom LogFactory implementation should be used but Class 
> 'org.apache.commons.logging.impl.LogFactoryImpl' cannot be converted to 
> 'org.apache.commons.logging.LogFactory'. The conflict is caused by the 
> presence of multiple LogFactory classes in incompatible classloaders. 
> Background can be found in http://commons.apache.org/logging/tech.html. If 
> you have not explicitly specified a custom LogFactory then it is likely that 
> the container has set one without your knowledge. In this case, consider 
> using the commons-logging-adapters.jar file or specifying the standard 
> LogFactory from the command line. Help can be found 
> @http://commons.apache.org/logging/troubleshooting.html.)
> at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1154)
> at java.security.AccessController.doPrivileged(Native Method)
> at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:957)
> at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:624)
> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
> at 
> org.apache.http.conn.ssl.DefaultHostnameVerifier.<init>(DefaultHostnameVerifier.java:72)
> at 
> org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:955)
> at 
> com.xxx.shared.ApacheFeignClientBuilder.getWithIgnoringSSL(ApacheFeignClientBuilder.java:21)
> at com.xxx.shared.ApiClient.<init>(ApiClient.java:66)
> at com.xxx.config.My.MyApiClient.<init>(MyApiClient.java:8)
> at com.xxx.config.My.MyApiFactory.getApiClient(MyApiFactory.java:163)
> at com.xxx.config.My.MyApiFactory.apiClient(MyApiFactory.java:131)
> at com.xxx.config.My.MyApiFactory.getClientGenericApi(MyApiFactory.java:125)
> at com.xxx.config.My.MyApiFactory.projectApi(MyApiFactory.java:111)
> at 
> com.xxx.config.My.MyApiFactory$$EnhancerBySpringCGLIB$$b779ec7a.CGLIB$projectApi$7(<generated>)
> at 
> com.xxx.config.My.MyApiFactory$$EnhancerBySpringCGLIB$$b779ec7a$$FastClassBySpringCGLIB$$597178f.invoke(<generated>)
> at 
> org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
> at 
> org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)
> at 
> com.xxx.config.My.MyApiFactory$$EnhancerBySpringCGLIB$$b779ec7a.projectApi(<generated>)
> ... 3 filtered
> at java.lang.reflect.Method.invoke(Method.java:498)
> at 
> org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
> ... 41 more
> Caused by: java.lang.ClassCastException: 
>  The application has specified that a custom LogFactory implementation should 
> be used but 
>  Class 'org.apache.commons.logging.impl.LogFactoryImpl' cannot be converted 
> to 'org.apache.commons.logging.LogFactory'. 
>  
>  The conflict is caused by the presence of multiple LogFactory classes in 
> incompatible classloaders. 
>  Background can be found in http://commons.apache.org/logging/tech.html. 
>  
>  If you have not explicitly specified a custom LogFactory then it is likely 
> that the container has set one without your knowledge.
>  In this case, consider using the commons-logging-adapters.jar file or 
> specifying the standard LogFactory from the command line. 
>  
>  Help can be found @http://commons.apache.org/logging/troubleshooting.html.
> {code}
>  
> {code:java}
> /**
>  * Default {@link javax.net.ssl.HostnameVerifier} implementation.
>  *
>  * @since 4.4
>  */
> @Immutable
> public final class DefaultHostnameVerifier implements HostnameVerifier {
>     enum TYPE { IPv4, IPv6, DNS };
>     final static int DNS_NAME_TYPE        = 2;
>     final static int IP_ADDRESS_TYPE      = 7;
>     // Error goes here
>     private final Log log = LogFactory.getLog(getClass());
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to