You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Steven Punte <st...@excite.com> on 2001/10/10 04:36:19 UTC

ConnectException on SECOND attempt! Why?

Dear Axis user group and development group:

   I sucessfully have an Axis based java soap client
   (i.e. just a stand alone program) communicating
   to an Axis based soap server.  Using OrionServer
   as the web server. 

   Everything works find: SOAP-XML back and fourth.

   Now, if I put the entire client code in a loop:
   i.e. (lots of details left out):
  
    for(...) {      
      ServiceClient call = new ServiceClient(opts.getURL());
      ServiceDescription sd = ....
      sd.addInputParam(.....
      call.invoke(....
    }

    I get a massive "java.net.ConnectException: Connection 
    refused: connect:"  on the second pass.  See below for 
    entire stack trace err msg.

    However, if I ONLY put the invoke() call in a loop: i.e.:

      ServiceClient call = new ServiceClient(opts.getURL());
      ServiceDescription sd = ....
      sd.addInputParam(.....
      for(...) {
        call.invoke(....
      }

    Everything works fine.  

    It looks like even though the ServiceClient object is 
    deleted, it still is somehow holding onto the socket.

    Any suggestions here on how to proceed?

    Sinclery:
      Steve P. Punte
      Candlelight Software
      
---------------------------

java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
	at java.net.Socket.<init>(Socket.java:273)
	at java.net.Socket.<init>(Socket.java:100)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:179)
	at org.apache.axis.SimpleTargetedChain.invoke(SimpleTargetedChain.java:100)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:166)
	at org.apache.axis.client.ServiceClient.invoke(ServiceClient.java:657)
	at org.apache.axis.client.ServiceClient.invoke(ServiceClient.java:571)
	at org.apache.axis.client.ServiceClient.invoke(ServiceClient.java:494)
	at com.amansi.soap.GetInventory.getInventory(GetInventory.java:68)
	at com.amansi.soap.GetInventory.main(GetInventory.java:109)





_______________________________________________________
Send a cool gift with your E-Card
http://www.bluemountain.com/giftcenter/