Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.net.ConnectException: Connection refused: connect

843833Sep 4 2005 — edited Aug 24 2006
Hi,
I am trying to run the following webservices program. It is basically the source code for the axis\WEB-INF\classes\samples\userguide\example1\TestClient.class which comes along with axis. Here is the code
import java.io.PrintStream;
import java.net.URL;
import javax.xml.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

public class TestClient
{

    public TestClient()
    {
    }

    public static void main(String args[])
    {
        try
        {
            String endpoint = "http://nagoya.apache.org:5049/axis/services/echo";
            Service service = new Service();
            Call call = (Call)service.createCall();
            call.setTargetEndpointAddress(new URL(endpoint));
            call.setOperationName(new QName("http://soapinterop.org/", "echoString"));
            String ret = (String)call.invoke(new Object[] {
                "Hello!"
            });
            System.out.println("Sent 'Hello!', got '" + ret + "'");
        }
        catch(Exception e)
        {
            System.err.println(e.toString());
            e.printStackTrace();
        }
    }
}
The program compiles fine, but when i try to execute, i get the following error
java.net.ConnectException: Connection refused: connect
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.net.ConnectException: Connection refused: connect
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
        at java.net.Socket.connect(Socket.java:452)
        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.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
        at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
	...
the list goes on ....

can anybody help me on this ????

Does it have anything do with
Found JAXP implementation ( javax.xml.parsers.SAXParserFactory ) at an unknown location
found on my axis happiness page.

Thanks,
WBAJ*
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 21 2006
Added on Sep 4 2005
4 comments
7,980 views