无法使用来自远程系统的ODI sdk连接到ODI

时间:2015-03-18 13:42:47

标签: java oracle-data-integrator

我正在尝试使用java中的ODI SDK连接到ODI。以下是获取ODI实例的代码:

MasterRepositoryDbInfo masterInfo = new MasterRepositoryDbInfo("jdbc:oracle:thin:@ipaddress:1521:xe", "oracle.jdbc.OracleDriver", username, password, new PoolingAttributes());
WorkRepositoryDbInfo workInfo = new WorkRepositoryDbInfo("WORKREP1", new PoolingAttributes());

final OdiInstance odiInstance = OdiInstance.createInstance(new OdiInstanceConfig(masterInfo, workInfo));

我收到以下错误:

Exception in thread "main" oracle.odi.core.config.WorkRepositoryResourceFailureException: ODI-10182: Uncategorized exception during repository access.  
Could not get JDBC Connection; nested exception is java.sql.SQLException: Exception occurred while getting connection: oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource: java.sql.SQLException: The Network Adapter could not establish the connection
    at oracle.odi.core.repository.Repository.getWorkRepository(Repository.java:195)
    at oracle.odi.core.OdiInstance.createWorkRepository(OdiInstance.java:531)
    at oracle.odi.core.OdiInstance.<init>(OdiInstance.java:678)
    at oracle.odi.core.OdiInstance.createInstance(OdiInstance.java:609)
    at oracle.odi.core.OdiInstance.createInstance(OdiInstance.java:548)
    at com.fe.FT2FT.main(FT2FT.java:66)

我通过创建到同一台机器的jdbc连接单独检查,我能够连接。

如果我遗漏了什么,请告诉我。任何帮助表示赞赏。

2 个答案:

答案 0 :(得分:0)

您与主存储库的连接正常,问题在于连接到工作存储库。请检查是否

  • 您的WORKREP1连接已在主存储库中正确定义
  • 您可以手动连接到工作存储库

还尝试仅连接到主存储库以查看它是否有效

final OdiInstance odiInstance = OdiInstance.createInstance(new OdiInstanceConfig(masterInfo, null));

答案 1 :(得分:0)

您应该使用主目录重新登录登录ODI,然后转到<?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $id = $_POST['hidden']; // if you are using ID, make sure variable is number if (is_numeric(id)) { delete from ergazomenos where trim(ID) ='$_POST[hidden]' /* create a prepared statement */ if ($stmt = mysqli_prepare($link, "DELETE FROM ergazomenos WHERE trim(ID) = ?")) { /* bind parameters for markers */ mysqli_stmt_bind_param($stmt, "s", $id); /* execute query */ mysqli_stmt_execute($stmt); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); } ?> 标签。

Topology下,转到Physical Architecture并打开代理。在Agents,代理主机不应是localhost,而应具有有效的合格主机名。

enter image description here