使用ODWEK

时间:2016-07-06 03:51:05

标签: java db2-content-manager

我尝试使用捆绑的ODWEK版本将AFP文档加载到Content Manager On Demand 9.5中。我试图按照这个示例显示其用途:

http://www-01.ibm.com/support/docview.wss?uid=swg21686382

我的代码目前是:

 ODServer odServer;
 ODConfig odConfig;
  System.setProperty("java.library.path", "/opt/ibm/ondemand/V9.5/www");
      odConfig = new ODConfig
         (ODConstant.PLUGIN,
               ODConstant.APPLET,
               null,
               200,
               "/applets",
               "ENU",
               "/home/pete",
               "/home/pete",
               4);
 odServer = new ODServer(odConfig);
 odServer.initialize("Logon.java");
 odServer.setPort(1445);
 odServer.logon("server.hostname", "user", "password");
 File file = new File("insure.afp");
 Hashtable<String,String> idxs = new Hashtable<>();
 idxs.put("CardNumber", "6969696969696969");
 idxs.put("CustomerName", "CMOD is cool");
 idxs.put("StatementDate", "2012-01-01");
 idxs.put("StatementType", "S");
 odServer.loadInit();
 odServer.loadAddDoc(1, idxs, file); 
 odServer.loadCommit("GoldCardsAG", "GoldCardsAafp");
 odServer.logoff( );
 odServer.terminate( );

我已确认GoldCardsAG是正确的应用程序组,而GoldCardsAafp是正确的applName。

我得到的错误是:

Exception in thread "main" com.ibm.edms.od.ODException: Failed to commit Load. Please consult the System Log for additional information.
RC = 2096
Message = The server failed while storing a document
    at com.ibm.edms.od.ODServer.loadCommit(ODServer.java:3230)
    at Logon.putFileBatch(Logon.java:47)
    at Logon.main(Logon.java:34)

上面发生异常的行是:

odServer.loadCommit("GoldCardsAG", "GoldCardsAafp");

我已经启用完整跟踪,这里有什么出现在arswww.trace中:

10844:140062709262080 07/06/2016 13:07:56:926797 FLOW arscsvdc.c(2633)CsvAddStoreDoc:Return csv_rc=9,CSV_RC_MISC_ERROR csv_msgid=15,CSV_MSG_SERVER_FAILED_DOC_STO
10844:140062709262080 07/06/2016 13:07:56:926811 FLOW ars3wapi.C(515)apiP_setReturnCodeAndMessage:Enter
10844:140062709262080 07/06/2016 13:07:56:926833 FLOW ars3wcom.C(1174)CmGuiGetString:Enter
10844:140062709262080 07/06/2016 13:07:56:926858 ERROR ars3wapi.C(7807)Java_com_ibm_edms_od_ArsWWWInterface_apiStoreDoc:Current state rtn.RC=9 extId=2096 pMsg=The server failed while storing a document
10844:140062709262080 07/06/2016 13:07:56:926863 FLOW ars3wapi.C(591)apiP_setReturnCodeAndMessage:Return
10844:140062709262080 07/06/2016 13:07:56:926878 FLOW ars3wapi.C(7856)Java_com_ibm_edms_od_ArsWWWInterface_apiStoreDoc:Return session id=140062577532816 (rc)=1

1 个答案:

答案 0 :(得分:0)

修复是在CMOD配置文件夹中的ars.cfg中添加以下2个参数:

ARS_DOWNLOAD_DIR=/tmp
ARS_DOWNLOAD_TMP_DIR=/tmp