title: Exception in connection to remote DOMINO server through JAVA application
body: <p>When I try to connect to the domino server from my java application i get an exception as follows:</p>
  
  <pre><code>NotesException: Could not open Notes session
  at lotus.domino.cso.Session.initSession(Unknown Source)
  at lotus.domino.cso.Session.&lt;init&gt;(Unknown Source)
  at lotus.domino.cso.Session.createSession(Unknown Source)
  at lotus.domino.NotesFactory.createSessionUP(Unknown Source)
  at lotus.domino.NotesFactory.createSession(Unknown Source)
  at lotus.domino.NotesFactory.createSession(Unknown Source)
  at com.nseit.email.ReadEmailRemotely.run(ReadEmailRem otely.java:23)
  at java.lang.Thread.run(Unknown Source)
  Caused by: org.omg.CORBA.COMM_FAILURE: java.net.ConnectException: Connection refused: connect Host: **127.0.0.1 Port: 63148** vmcid: 0x0 minor code: 1 completed: No
  at lotus.priv.CORBA.iiop.ConnectionTable.get(Unknown Source)
  at lotus.priv.CORBA.iiop.ConnectionTable.get(Unknown Source)
  at lotus.priv.CORBA.iiop.Generic.getConnection(Unknow n Source)
  at lotus.priv.CORBA.iiop.Generic.locate(Unknown Source)
  at lotus.priv.CORBA.iiop.RepImpl.invokePreamble(Unkno wn Source)
  at lotus.priv.CORBA.iiop.RepImpl.invoke(Unknown Source)
  at lotus.priv.CORBA.portable.ObjectImpl._invoke(Unkno wn Source)
  at lotus.domino.corba._IObjectServerStub.createSessio n(Unknown Source)
  ... 8 more
  Caused by: java.net.ConnectException: Connection refused: connect
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at java.net.PlainSocketImpl.doConnect(Unknown Source)
  at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
  at java.net.PlainSocketImpl.connect(Unknown Source)
  at java.net.SocksSocketImpl.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at java.net.Socket.&lt;init&gt;(Unknown Source)
  at java.net.Socket.&lt;init&gt;(Unknown Source)
  at lotus.priv.CORBA.iiop.Connection.newSocket(Unknown Source)
  ... 16 more
  </code></pre>
  
  <p><em><strong>Here is my java code:</em></strong></p>
  
  <pre><code>import lotus.domino.*;
  
  public static void main(String argv[])
  {
  ReadEmailRemotely t = new ReadEmailRemotely();
  Thread nt = new Thread((Runnable)t);
  nt.start();
  }
  
  public void run()
  {
  try
  {
  String host = "xxx.xxx.xxx.xx:63148";
  Session s = NotesFactory.createSession(host);
  
  }
  catch(Exception e)
  {
  e.printStackTrace();
  }
  }
  </code></pre>
  
  <p>I am using <strong>NCSO.jar</strong> and I have verified all the setting of DIIOP connection is correct.</p>
  
  <p>Since I am providing the <strong>HARDCODE IP Address</strong> why do my JAVA Application trying to connect localhost IP (127.0.0.1)</p>
  
  <p><strong>Any suggestion on this would be of great help.</strong></p>
  
  <p>On executing the following command  <strong>tell diiop show config</strong> on DOMINO server the console output shows several parameters out of which 2 parameters shows as</p>
  
  <p>Host Address:  127.0.0.1
  Public Host Name/Address:  127.0.0.1</p>
  
  <p>Is this the cause for the above exception?</p>