当我尝试从我的java应用程序连接到domino服务器时,我得到如下例外:
NotesException: Could not open Notes session
at lotus.domino.cso.Session.initSession(Unknown Source)
at lotus.domino.cso.Session.<init>(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.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at lotus.priv.CORBA.iiop.Connection.newSocket(Unknown Source)
... 16 more
这是我的java代码:
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();
}
}
我正在使用 NCSO.jar ,我已经验证了DIIOP连接的所有设置都是正确的。
由于我提供 HARDCODE IP地址,为什么我的JAVA应用程序尝试连接localhost IP(127.0.0.1)
对此有任何建议都会有很大帮助。
在DOMINO服务器上执行以下命令告知diiop show config 时,控制台输出会显示几个参数,其中2个参数显示为
主机地址:127.0.0.1 公共主机名/地址:127.0.0.1
这是导致上述异常的原因吗?
答案 0 :(得分:4)
我不确定你为什么得到127.0.0.1,但错误“Connection Refused”通常意味着DIIOP没有在该端口上运行。
从Domino服务器类型
load diiop
之后尝试直接连接到IOR_TEXT以确保它正在运行(使用Web浏览器)。
示例:
http://xxx.xxx.xxx.xxx:63148/diiop_ior.txt
如果服务器工作正常,你应该得到一串数字。