1 2 Previous Next 15 Replies Latest reply on May 24, 2005 5:19 PM by jobor

    HTTPS : java.net.SocketTimeoutException: Read timed out

    jobor

      Hello,

      I'm using JBoss 4.0.1sp1 and JDK 1.4.2_07. I.m calling an external web service from SLSB. I'm not using stubs. One method is written with dynamic proxy, the second one is written with DII.
      When I call the web service over http both methods return good results. But when I change the url in the deployed WSDL the https variant than Im getting the above error.
      I have build also a client stubs test with wscompile using the https url and this is also working nice.
      Is there something I forget using HTTPS? I did also import the certificate in the cacerts keystore. But the certificate was signed by a trusted root certificate of VeriSign.

      Server.log


      2005-04-12 16:31:43,078 ERROR [org.jboss.webservice.client.PortProxy] Port error
      java.lang.reflect.UndeclaredThrowableException
      at $Proxy203.getDomainInformation(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:111)
      at $Proxy204.getDomainInformation(Unknown Source)
      at nl.vda.won.tv.j2ee.ejb.DomainAgentBean.getDomain(DomainAgentBean.java:99)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:113)
      at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:122)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      at org.jboss.ejb.Container.invoke(Container.java:870)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at com.sun.net.ssl.internal.ssl.InputRecord.a(DashoA12275)
      at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA12275)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
      at com.sun.net.ssl.internal.ssl.AppInputStream.read(DashoA12275)
      at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
      at java.io.FilterInputStream.read(FilterInputStream.java:111)
      at org.apache.xerces.impl.XMLEntityManager$RewindableInputStream.read(Unknown Source)
      at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
      at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
      at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at javax.xml.parsers.SAXParser.parse(Unknown Source)
      at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:258)
      at org.apache.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:657)
      at org.apache.axis.Message.getSOAPEnvelope(Message.java:430)
      at org.apache.axis.client.Call.invokeEngine(Call.java:3052)
      at org.apache.axis.client.Call.invoke(Call.java:3014)
      at org.apache.axis.client.Call.invoke(Call.java:2608)
      at org.apache.axis.client.Call.invoke(Call.java:2513)
      at org.apache.axis.client.Call.invokeInternal(Call.java:1973)
      at org.apache.axis.client.Call.invoke(Call.java:1914)
      at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:265)
      at org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:372)
      ... 48 more


      ejb-jar.xml
      <!-- Session Beans -->
      <session>
       <ejb-name>DomainAgent</ejb-name>
       <home>nl.vda.won.tv.j2ee.ejb.DomainAgentRemoteHome</home>
       <remote>nl.vda.won.tv.j2ee.ejb.DomainAgentRemote</remote>
       <local-home>nl.vda.won.tv.j2ee.ejb.DomainAgentLocalHome</local-home>
       <local>nl.vda.won.tv.j2ee.ejb.DomainAgentLocal</local>
       <ejb-class>nl.vda.won.tv.j2ee.ejb.DomainAgentBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       <service-ref>
       <service-ref-name>service/WOnSoapService</service-ref-name>
       <service-interface>wonsoapnamespace.WOnSoapInterface_Service</service-interface>
       <wsdl-file>META-INF/wsdl/won_soap_test.wsdl</wsdl-file>
       <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
       </service-ref>
       <service-ref xmlns:ns="urn:wonsoapnamespace">
       <service-ref-name>service/WOnSoapService2</service-ref-name>
       <service-interface>javax.xml.rpc.Service</service-interface>
       <wsdl-file>META-INF/wsdl/won_soap_test.wsdl</wsdl-file>
       <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
       <service-qname>ns:WOnSoapInterface</service-qname>
       </service-ref>
      </session>
      


      Part of the deployed wsdl in /META-INF/wsdl
       <service name="WOnSoapInterface">
       <port name="WOnSoapInterface" binding="ns:WOnSoapInterface">
       <soap:address location="https://[server]:[port]/WOn"/>
       </port>
       </service>
      </definitions>
      


      T.I.A. Johan

        • 1. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
          md5georg

          Hello,

          I not sure what you are changing... the deployed wsdl? The one under JBOSS_HOME/server/data/wsdl.... seams just to be a reflection of the services you already have deployed. I dont think changes in that file have any effect. Try setting "https:" before the WebServiceHost attribute in the

          JBOSS_HOME/server/deploy/jboss-ws4ee.sar/META-INF/jboss-service.xml file instead and re-deploy.

          Just as Jason describes here:

          http://www.jboss.org/index.html?module=bb&op=viewtopic&t=62171


          /Georg

          • 2. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
            md5georg

            Sorry... re-start.... not re-deploy. :)

            /Georg

            • 3. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
              md5georg

              Sorry for this... I realize that I answered to hasty... Ignore my comments.

              /Georg

              • 4. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                jobor

                Hello,

                I'm using the JBoss server as a client of a "Smalltalk" webservice. I did not want to deploy stubs on the JBoss server with the EJB's. I want to use just the material JBoss offers to use an stateless session bean as a client. So I deployed a stateless session bean with 2 service-ref elements. The first for using with dynamic proxy, the second for using with DII.

                Dynamic proxy

                InitialContext context = new InitialContext();
                WOnSoapInterface_Service service = (WOnSoapInterface_Service) context.lookup("java:comp/env/service/WOnSoapService");
                WOnSoapInterface_PortType port = service.getWOnSoapInterface();
                result = port.getDomainInformation(clientId, domain);
                


                DII
                InitialContext context = new InitialContext();
                Service service = (Service) context.lookup("java:comp/env/service/WOnSoapService2");
                QName port = new QName("ns:WOnSoapInterface", "WOnSoapInterface");
                QName operation = new QName("ns:WOnSoapInterface", "GetDomainInformation");
                Call call = service.createCall(port, operation);
                Object[] inputParams = new Object[] {clientId, domain};
                result = (String) call.invoke(inputParams);
                


                I do deploy the WSDL document of the "Smalltalk" webservice in the META-INF/wsdl directory of the EJB deployment.
                I also have a XML mapping file for converting complex values.
                When the deployed WSDL document is pointing to an HTTP URL in the service element the web service is working fine and I'm getting a good result from the dynamic proxy approach and from the DII approach.

                The also have the same service running over HTTPS. (= test) So changing the HTTP URL into the HTTPS URL then I'm getting the time out error.

                I also told that calling the HTTPS webservice with client stubs generated with wscompile also returns a good result.

                Any idea what I'm forgetting or something else?

                Johan

                • 5. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                  jason.greene

                  This really looks like a networking problem. Did you run the wscompile stubs on the same host that your jboss server is running on? Could it be possible that that host doesnt have propper outbound or inbound access? Did you specify the port in that wsdl string?

                  There are a couple things you can do to troubleshoot this. Run netstat on the jboss box when you issue a request, and see if you have a connection that is in SYN_WAIT, or some other non established state.

                  What platform is the jboss server? If it is a unix box you can run snoop or tcpdump on the system to grab a network dump. If it is a windows box, and you have acesss you can install ethereal on the system. (Ethereal can read snoop and tcpdump files as well)

                  Thanks,
                  -Jason


                  • 6. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                    jobor

                    Hello,

                    I forgot to tell that all things are happening on my Windows laptop and I do have Ethereal. I'm testing JBoss 4 to see if we can replace the Jboss 3 (production) server. The JBoss 3 server now uses SLSB's and Axis 1.1 client stubs to access the HTTPS webservice.

                    Also I did the wscompile on my laptop for generating stubs.

                    Stub call

                    WOnSoapInterface_Service_Impl service = new WOnSoapInterface_Service_Impl();
                    WOnSoapInterface_PortType_Stub stub = (WOnSoapInterface_PortType_Stub) service.getWOnSoapInterface();
                    stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "https://[server]:[port]/WOn");
                    result = stub.getDomainInformation(clientId, domain);

                    
                    Pfff... You really are naming some network technical things.
                    I'm not a network expert :-( but I will try to look for some things.
                    B.t.w. I do use Ethereal for seeing how the SOAP messages look like.
                    
                    I'm still wondering why the Stub call works over https and the dynamic proxy and DII calls not.
                    I can see that the Stub call is working because Ethereal does show the SOAP message scrambled if I follow the tcp stream and I'm getting the good result.
                    
                    T.I.A.
                    
                    Johan


                    • 7. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                      thomas.diesler

                      If your target is a smalltalk web service, can you somehow provide a simple webapp that you can access from a browser via https?

                      Also does the smalltalk endpoint offer a GET for the wsdl? Try that from a browser via https.

                      Finally, use some simple java to retrieve content from that server via https.

                      I also think it could be a transport issue and not really a WS issue

                      • 8. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                        jobor

                        Hello,

                        Thanks for answers. I did some work with Ethereal.
                        The test environment on the smalltalk side has 2 urls, one without https and one with https. I only have to change the port and protocol.
                        I did generate stubs with (jwsdp-1.5) wscompile. The smalltalk side has not a wsdl document available on the site but we get the WSDL private. With the stub test I only use the SUN libs delivered with jwsdp-1.5.
                        What I could see was that working with the stub version of SUN the the 2 urls do return good data. Because I do get a good results in both cases. I checked with Ethereal if one test is really over https and this was the case as I could see the scrambled data coming in and information of the certificate.

                        So back to JBoss and using the 4.0.1sp1 as it is. I do the same test again with the dynamic proxy, one call over http and one call over htpps with the SLSB. The call over http gives a good result and the call over https gives a time out :-(

                        But what I saw with Ethereal was that with the call over https all the data is coming back after 2 seconds in bot cases. I also could see the scrambles data coming back over https an information about the certificate info.
                        But in the case of https the data comes back in about 2 seconds but JBoss never sees that it has arrived. Or it can't see a sort of EOF.
                        JBoss waits 1 minute and then gives the error which you can see at the top of this thread.

                        So it seems that I do not have network problems with the https url.
                        But why does JBoss not see that the data has been received?

                        T.I.A. Johan

                        • 9. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                          jobor

                          Hello,

                          I did also a test with JBoss-4.0.2RC1. The same results. I still get the time out over https.

                          But I think I know why do get the time out. The URL below is an example of the data that is coming back asking for countries of the http connection.
                          But if I do ask another domain I do get back data over https.
                          But what is the difference?
                          I think it has do do something with corrupt characters. If e.g. the word Slovenië is returned you can see in the example that the value is Slovenië.
                          I also tried another domain with a few special characters and that domain also gives a time out.
                          It seems that with https the reader gets confused and waits for some ending which wil not come and after 1 minute he gives up.

                          We should talk with the people on the other side why they give bad characters.
                          But on the other hand the stubs of SUN are able to read over https and JBoss is only able to read over http those bad characters.

                          http://www.solcon.nl/jborchers/GetDomainInformation.txt

                          T.I.A. Johan.

                          • 10. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                            jobor

                            Hello,

                            Is there a possibility that a reader in JBoss can have a time out because it sees no end due to bad characters while using https!

                            Johan

                            • 11. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                              jobor

                              Hello,

                              Also a test with Axis 1.1 stubs, just as we are using now, the reader gets the time out exception when used over https.

                              Johan

                              • 12. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                                jobor

                                Hello,

                                I'm getting tired but debugging in Eclipse shows that the characters ë in the word Slovenië are correct translated to ë. Because a test with a lot bigger result coming with the same characters gives a good result over https.

                                So for me it is a mystery why you can see that after 2 seconds you see the result coming in over https with Ethereal and the reader in JBoss still waits for some ending.

                                Johan

                                • 13. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                                  jobor

                                  Hello,

                                  I did not get an answer on the question if bad characters could disturb the reading of SOAP. So I assume this is not the case.

                                  But why can I read 2 domains over https with the SUN stubs and why not with JBossWS or Axis?
                                  Someone was saying to me that it could be that a port is not closed????
                                  I'm not a http expert so I will show the 2 SOAP calls over http.

                                  JBoss Dynamic Proxy SOAP call over http

                                  POST /WOn HTTP/1.0
                                  Content-Type: text/xml; charset=utf-8
                                  Accept: application/soap+xml, application/dime, multipart/related, text/*
                                  User-Agent: Axis/#axisVersion#
                                  Host: [server]:[port]
                                  Cache-Control: no-cache
                                  Pragma: no-cache
                                  SOAPAction: ""
                                  Content-Length: 515
                                  
                                  <?xml version="1.0" encoding="UTF-8"?>
                                  <soapenv:Envelope
                                   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                                   <soapenv:Body>
                                   <ns1:GetDomainInformation xmlns:ns1="urn:wonsoapnamespace">
                                   <clientID>
                                   <user>[username]</user>
                                   <password>[password]</password>
                                   <departmentId>[department]</departmentId>
                                   </clientID>
                                   <domainID>Country</domainID>
                                   </ns1:GetDomainInformation>
                                   </soapenv:Body>
                                  </soapenv:Envelope>HTTP/1.1 200
                                  Content-Type: text/xml;charset=utf-8
                                  Content-Length: 25694
                                  Connection: close
                                  
                                  <?xml version="1.0" encoding="UTF-8"?>
                                  <SOAP-ENV:Envelope
                                   xmlns:m="urn:wonsoapnamespace"
                                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                                   xmlns:s="http://www.w3.org/2001/XMLSchema">
                                   <SOAP-ENV:Body>
                                   <m:GetDomainInformationResponse>
                                   <return xsi:type="s:string">[lot of text]</return>
                                   </m:GetDomainInformationResponse>
                                   </SOAP-ENV:Body>
                                  </SOAP-ENV:Envelope>
                                  


                                  SUN Stub SOAP call over http
                                  POST /WOn HTTP/1.1
                                  Content-Type: text/xml; charset=utf-8
                                  Content-Length: 536
                                  SOAPAction: ""
                                  User-Agent: Java/1.4.2_07
                                  Host: [server]:[port]
                                  Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
                                  Connection: keep-alive
                                  
                                  <?xml version="1.0" encoding="UTF-8"?>
                                  <env:Envelope
                                   xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
                                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                   xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
                                   xmlns:ns0="urn:wonsoapnamespace">
                                   <env:Body>
                                   <ns0:GetDomainInformation>
                                   <clientID>
                                   <ns0:user>[username]</ns0:user>
                                   <ns0:password>[password]</ns0:password>
                                   <ns0:departmentId>[department]</ns0:departmentId>
                                   </clientID>
                                   <domainID>Country</domainID>
                                   </ns0:GetDomainInformation>
                                  </env:Body>
                                  </env:Envelope>HTTP/1.1 200
                                  Content-Type: text/xml;charset=utf-8
                                  Content-Length: 25694
                                  Connection: Keep-Alive
                                  
                                  <?xml version="1.0" encoding="UTF-8"?>
                                  <SOAP-ENV:Envelope
                                   xmlns:m="urn:wonsoapnamespace"
                                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                                   xmlns:s="http://www.w3.org/2001/XMLSchema">
                                   <SOAP-ENV:Body>
                                   <m:GetDomainInformationResponse>
                                   <return xsi:type="s:string">[lot of text]</return>
                                   </m:GetDomainInformationResponse>
                                   </SOAP-ENV:Body>
                                  </SOAP-ENV:Envelope>
                                  


                                  During the https call with JBoss until I get the time out I can see with netstat - b :
                                   TCP [mylaptop]:2141 [server]:[port] ESTABLISHED 616
                                   [javaw.exe]
                                  


                                  Maybe something is going wrong with the https connection port?

                                  Johan

                                  • 14. Re: HTTPS : java.net.SocketTimeoutException: Read timed out
                                    thomas.diesler

                                    Please provide a simple sample deployment attached to a JIRA issue that allows us to reproduce what you are seeing.

                                    1 2 Previous Next