I'm trying to load an AFP document into Content Manager On Demand 9.5 using the bundled version of ODWEK. I'm trying to follow this example showing its use:
http://www-01.ibm.com/support/docview.wss?uid=swg21686382
My code is currently:
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( );
I've confirmed that GoldCardsAG is the correct Application Group and GoldCardsAafp is the correct applName.
The error I get is:
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)
The line above that the exception is occurring at is:
odServer.loadCommit("GoldCardsAG", "GoldCardsAafp");
I've enabled full trace, here's whats appearing in 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
The fix was to add the following 2 params in ars.cfg within the CMOD config folder:
ARS_DOWNLOAD_DIR=/tmp
ARS_DOWNLOAD_TMP_DIR=/tmp