2014-10-28 71 views
0

我有一個webapp需要部署到Websphere 8.5,(它在tomcat 7中工作正常)。這個應用程序調用另一個應用程序的REST web服務,並使用HttpClient。當我啓動應用程序,我得到以下錯誤:Websphere HttpClient java.lang.NoSuchMethodError:org/apache/http/conn/ssl/SSLSocketFactory。 <init>

Caused by: java.lang.NoSuchMethodError: org/apache/http/conn/ssl/SSLSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Lorg/apache/http/conn/ssl/X509HostnameVerifier;)V 
     at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.initDefaultEngine(ResteasyClientBuilder.java:418) 
     at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.build(ResteasyClientBuilder.java:333) 
     at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.build(ResteasyClientBuilder.java:49) 
     at javax.ws.rs.client.ClientBuilder.newClient(ClientBuilder.java:114) 
     at com.qmino.matrix.calculation.engine.EngineInstance.<init>(EngineInstance.java:23) 
     at com.qmino.matrix.calculation.engine.CalculationEngine.<init>(CalculationEngine.java:61) 
     at com.qmino.matrix.calculation.engine.ThreadPool.<init>(ThreadPool.java:29) 
     at com.qmino.matrix.calculation.engine.application.Application.getThreadPool(Application.java:53) 
     at com.qmino.matrix.calculation.engine.application.Application$$EnhancerBySpringCGLIB$$57778e16.CGLIB$getThreadPool$0(<generated>) 
     at com.qmino.matrix.calculation.engine.application.Application$$EnhancerBySpringCGLIB$$57778e16$$FastClassBySpringCGLIB$$d67ab8c2.invoke(<generated>) 
     at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) 
     at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) 
     at com.qmino.matrix.calculation.engine.application.Application$$EnhancerBySpringCGLIB$$57778e16.getThreadPool(<generated>) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) 
     at java.lang.reflect.Method.invoke(Method.java:611) 
     at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) 
     ... 120 more 

我發現this question但它不是真正的幫助。任何人都可以幫助我嗎?

回答

4

Httpclient庫與WebSphere提供的衝突。請嘗試通過Environment > Shared libraries創建獨立共享庫,將http客戶端jar放在那裏並將該庫映射到應用程序。查看此文章的更多詳細信息WebSphere 8.5 and Apache HTTP Client

相關問題