views:

2086

answers:

1

Hello, I am using Java 1.5.0_16 (JBoss-4.2.3.GA application). My application implements a WS client which needs to integrate with an external Web Service. This communication needs to be handled through https.I am getting following error when i trying to call remote Api via web services.can anybosy help me out what could be the cause

14:25:17,609 WARN  [HTTPClientInvoker] Unable to create SSL Socket Factory for client invoker: Error initializing socket factory SSL context: Can not find truststore url.
14:25:18,203 INFO  [STDOUT] ERROR:
14:25:18,203 ERROR [STDERR] javax.xml.ws.WebServiceException: java.io.IOException: Could not transmit message
14:25:18,203 ERROR [STDERR]     at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:404)
14:25:18,203 ERROR [STDERR]     at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:314)
14:25:18,203 ERROR [STDERR]     at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:172)
14:25:18,203 ERROR [STDERR]     at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:152)
14:25:18,203 ERROR [STDERR]     at $Proxy95.getConnectionDetails(Unknown Source)
14:25:18,203 ERROR [STDERR]     at testjava.Test.testWebservice(Test.java:113)
14:25:18,203 ERROR [STDERR]     at com.digital88.billing.dao.WholesalerDAOImpl.findByUserNameAndPassword(WholesalerDAOImpl.java:61)
14:25:18,203 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:25:18,203 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
14:25:18,203 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:25:18,203 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:585)
14:25:18,203 ERROR [STDERR]     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
14:25:18,203 ERROR [STDERR]     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
14:25:18,203 ERROR [STDERR]     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
14:25:18,203 ERROR [STDERR]     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
14:25:18,203 ERROR [STDERR]     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
14:25:18,203 ERROR [STDERR]     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
14:25:18,203 ERROR [STDERR]     at $Proxy79.findByUserNameAndPassword(Unknown Source)
14:25:18,203 ERROR [STDERR]     at com.digital88.billing.services.WholesalerServiceImpl.authenticate(WholesalerServiceImpl.java:67)
14:25:18,203 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:25:18,203 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
14:25:18,203 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:25:18,203 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:585)
14:25:18,203 ERROR [STDERR]     at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:406)
14:25:18,203 ERROR [STDERR]     at net.sf.gilead.blazeds.adapter.PersistentAdapter.invoke(PersistentAdapter.java:123)
14:25:18,203 ERROR [STDERR]     at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
14:25:18,203 ERROR [STDERR]     at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1417)
14:25:18,203 ERROR [STDERR]     at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:878)
14:25:18,203 ERROR [STDERR]     at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
14:25:18,203 ERROR [STDERR]     at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
14:25:18,203 ERROR [STDERR]     at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:49)
14:25:18,203 ERROR [STDERR]     at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
14:25:18,203 ERROR [STDERR]     at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
14:25:18,203 ERROR [STDERR]     at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274)
14:25:18,203 ERROR [STDERR]     at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:377)
14:25:18,203 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
14:25:18,203 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
14:25:18,203 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
14:25:18,203 ERROR [STDERR]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
14:25:18,203 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
14:25:18,203 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
14:25:18,203 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
14:25:18,203 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
14:25:18,203 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
14:25:18,203 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
14:25:18,203 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
14:25:18,203 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
14:25:18,203 ERROR [STDERR]     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
14:25:18,203 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
14:25:18,203 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
14:25:18,203 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
14:25:18,203 ERROR [STDERR]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
14:25:18,203 ERROR [STDERR]     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
14:25:18,203 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:595)
14:25:18,203 ERROR [STDERR] Caused by: java.io.IOException: Could not transmit message
14:25:18,203 ERROR [STDERR]     at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:255)
14:25:18,203 ERROR [STDERR]     at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:73)
14:25:18,203 ERROR [STDERR]     at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:339)
14:25:18,203 ERROR [STDERR]     at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
14:25:18,203 ERROR [STDERR]     ... 52 more
14:25:18,203 ERROR [STDERR] Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker. cannot retry due to redirection, in streaming mode. Response
: Found/302.
14:25:18,203 ERROR [STDERR]     at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:348)
14:25:18,203 ERROR [STDERR]     at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:137)
14:25:18,203 ERROR [STDERR]     at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
14:25:18,203 ERROR [STDERR]     at org.jboss.remoting.Client.invoke(Client.java:1634)
14:25:18,203 ERROR [STDERR]     at org.jboss.remoting.Client.invoke(Client.java:548)
14:25:18,203 ERROR [STDERR]     at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:233)
14:25:18,203 ERROR [STDERR]     ... 55 more
14:25:18,203 ERROR [STDERR] Caused by: java.net.HttpRetryException: cannot retry due to redirection, in streaming mode
14:25:18,203 ERROR [STDERR]     at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:1695)
14:25:18,203 ERROR [STDERR]     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1106)
14:25:18,203 ERROR [STDERR]     at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
14:25:18,203 ERROR [STDERR]     at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318)
14:25:18,203 ERROR [STDERR]     at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:282)
14:25:18,203 ERROR [STDERR]     ... 60 more
14:25:18,203 INFO  [STDOUT] connectionDetails..
A: 

I have two possible solutions to this:

  • Your stack trace chain includes a nested exception with the message

org.jboss.remoting.CannotConnectException: Can not connect http client invoker. cannot retry due to redirection, in streaming mode. Response : Found/302

So are you absolutely sure you're pointing at the correct URL? Looks like the JBoss code isn't handling a 302 redirect.

  • I have a vague memory that in order to use client-side SSL in JBoss, you first need to configure the server-side part

In other words, your JBOss's web server must have its SSL connector fully configured in order to receive asynch callbacks from the client call. This sounds pretty daft, but it's worth investigating, since I've come across something similar before.

So have a dig aout in jboss-web's server.xml and see if the SSL connector is there and configured. This bit of config includes a keystore URL, and if that's not configured, that might explain the "cannot find keystore" exception.

skaffman