java - 使用 Java 的 Domino 数据库连接问题
问题描述
我正在尝试使用以下 java 代码连接 IBM Domino DB,但出现异常。
import lotus.domino.Database;
import lotus.domino.NotesFactory;
import lotus.domino.Session;
public class JavaAgent {
public static void main(String[] args) {
try {
String host = "test.xxx.xxx.com:63148";
Session s = NotesFactory.createSession(host);
String p = s.getCommonUserName();
System.out.println(p);
Database db = s.getDatabase("test.xxx.xxx.com", "s.nsf");
System.out.println(db.getFilePath());
} catch (Exception e) {
e.printStackTrace();
}
}
}
## 例外 : ##
NotesException:无法从 Domino 服务器获取 IOR: http ://test.xxx.xxx.com: 63148/diiop_ior.txt at lotus.domino.NotesFactory.requestIORPlain(Unknown Source) at lotus.domino.NotesFactory.requestIORUsingArgs(Unknown Source ) 在 lotus.domino.NotesFactory.getIOR(Unknown Source) at lotus.domino.NotesFactory.createSessionUP(Unknown Source) at lotus.domino.NotesFactory.createSession(Unknown Source) at lotus.domino.NotesFactory.createSession(Unknown Source)
I tried to open the URL from browser using port 80 then it loading the file mentioned in error http://test.xxx.xxx.com:80/diiop_ior.txt
DIIOP 配置如下
tell diiop show config
[167FC:0002-16B70] Dump of Domino IIOP (DIIOP) Configuration Settings
[167FC:0002-16B70] Full Server Name: CN=xxx/O=xxxDEV
[167FC:0002-16B70] Common Server Name: xxx/xxxDEV
[167FC:0002-16B70] Refresh Interval: 3 minutes
[167FC:0002-16B70] Host Full Name: test.xxx.xxx.com
[167FC:0002-16B70] Host Short Name: xxx
[167FC:0002-16B70] Host Address: xxx.xxx.xx.1xx
[167FC:0002-16B70] Public Host Name/Address: test.xxx.xxx.com
[167FC:0002-16B70] TCP Port: 63148 Enabled
[167FC:0002-16B70] SSL Port: 0 Disabled
[167FC:0002-16B70] Initial Net Timeout: 120 seconds
[167FC:0002-16B70] Session Timeout: 60 minutes
[167FC:0002-16B70] Client Session Timeout: 62 minutes
[167FC:0002-16B70] IOR File: J:\Lotus\Domino\data\domino\html\diiop_ior.txt
[167FC:0002-16B70] Allow Ambiguous Names: True
[167FC:0002-16B70] Web Name Authentic: False
[167FC:0002-16B70] User Lookup View: ($LDAPCN)
[167FC:0002-16B70] Allow Database Browsing: True
[167FC:0002-16B70] TCP Name/Password Allowed: True
[167FC:0002-16B70] TCP Anonymous Allowed: True
[167FC:0002-16B70] SSL Name/Password Allowed: False
[167FC:0002-16B70] SSL Anonymous Allowed: True
[167FC:0002-16B70] Multi-Server Session Authentication: Disabled
[167FC:0002-16B70] Internet Sites: Disabled
[167FC:0002-16B70] Single Server Cookies: Enabled
我正在使用 NCSO.jar 进行此连接。我正在按照以下 IBM 官方网址 https://www.ibm.com/developerworks/lotus/library/ls-Java_access_pt1/index.html中提到的步骤进行操作
解决方案
这个问题得到解决。IBM Domino 服务器默认端口 - Windows 代理中未启用 63148,因为在连接到 domino 服务器时出现此问题。
按照以下步骤在 Windows 10 上启用端口 -
[ http://www.tomshardware.com/faq/id-3114787/open-firewall-ports-windows.html]
推荐阅读
- strapi - 如何存储/访问strapi动态/自定义数据库配置?
- reactjs - ReactNative State 不会立即改变,所以我该如何解决我的问题?
- python - 如何在 python 中的 models.py 中包含非 DB 字段?
- java - Keycloak 用户存储 SPI - 为什么 getUserById 在从 UserLookupProvider 接口的 getUserByUsername 后调用 4 次
- python - Matplotlib 蜡烛彼此靠得太近
- python - 如何从需要登录的网站上抓取信息
- javascript - 正则表达式获取字符串JS之间的单词
- python - 将多个嵌套字典作为单行放入 Dataframe
- c# - 第一次尝试自动完成
- android - 尽管使用了不同的 ID,但无法启动 Pending Intent 的多个实例