2013-10-03 64 views
6

我創建了一個連接到WSO2 Identity Server並驗證令牌的AXIS服務。 當我在WSO2 App Server上部署此軸服務時,我得到正確的響應。 在哪裏,當我將它部署WSO2 ESB,我收到以下錯誤WSO2 ESB Axis2服務拋出主機名驗證失敗

org.apache.axis2.AxisFault: The input stream for an incoming message is null. 
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:93) 
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:68) 
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:346) 
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:413) 
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224) 
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149) 
at org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub.validate(OAuth2TokenValidationServiceStub.java:184) 
at com.xxx4.yyy.security.token.service.TokenValidationService.validateToken(TokenValidationService.java:67) 
at com.xxx4.yyy.security.token.facade.TokenValidationFacade.validateToken(TokenValidationFacade.java:16) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212) 
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117) 
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) 
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110) 
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) 
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:404) 
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:184) 
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
at java.lang.Thread.run(Thread.java:724) 

[2013年10月3日14:42:56,160]錯誤 - TargetHandler I/O錯誤:主機名驗證失敗主機: 172.20.5.110 javax.net.ssl.SSLException:主機的主機名驗證失敗:172.20.5.110 at org.apache.synapse.transport.http.conn.ClientSSLSetupHandler.verify(ClientSSLSetupHandler.java:152) at org。 apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:285) at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:372) at org.apache。 http.impl.nio.reactor.AbstractIODispatch.inpu tReady(AbstractIODispatch.java:118) at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent( AbstractIOReactor.java:342) at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor。 java:280) at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor $ Worker.run(AbstractMultiworkerIOReactor。 java:604) at java.lang.Thread.run(Thread.java:724)

回答

13

設置對於Axis2配置(axis2.xml)中的transportSender,參數HostnameVerifierAllowAll

<transportSender name="https" class="org.apache.synapse.transport.passthru.PassThroughHttpSSLSender"> 
    <!--...--> 
    <!--supports Strict|AllowAll|DefaultAndLocalhost or the default if none specified --> 
    <parameter name="HostnameVerifier">AllowAll</parameter> 
    <!--supports Strict|AllowAll|DefaultAndLocalhost or the default if none specified --> 
</transportSender> 
+0

謝謝,它解決了這個問題。但是,現在我收到了另一個錯誤 - 錯誤 - AxisEngine消息接收器找不到AxisOperation。然而它在AS上工作100% - 請在這方面提出任何想法! –

+0

以下是我收到的錯誤 - AxisEngine消息接收器未找到AxisOperation:{http://oauth2.identity.carbon.wso2.org}驗證 org.apache.axis2.AxisFault:找不到AxisOperation消息接收器: {http://oauth2.identity.carbon.wso2.org}驗證 –

+0

當我將transportSender從ESB默認的一個更改爲https的默認值時 - 它按預期工作。我不確定這是否正確,請建議! –