0

非常感谢解决此 invokeDataControl 方法的任何帮助。请在下面找到该问题的完整参考链接。我基本上是在尝试执行一个 Oracle/Java MAF 示例来理解这个概念并将其呈现给用户,以应对关键的 go/no-go 情况。

环境:

1) Jdeveloper 12.1.3.0.0 2) MAF 2.0.1 3) 尝试示例: https ://java.net/projects/smuenchadf/pages/ADFMobile 中的 DSI037 或“ http://deepakcs.blogspot.com/2013/ 06/offline-data-synchronization-for-adf.html " 4) MAC OS 10.9 5) WebLogic 12C 6) 错误信息

[严重 - oracle.adfmf.framework - HttpServiceConnection - 日志] 连接错误:500 [严重 - oracle.adfmf.framework - HttpTransport - parseResponse] 响应 [错误:{0}]:{1} [严重 - oracle.adfmf.framework - SoapTransportLayer - invokeSoapRequest] 调用 SOAP 请求时遇到异常端点:http://XXX.XXX.XXX.XXX: 80/ EJBSyncWebServiceApp /SessionFacadeBeanService SOAPAction:“ http://service.soap.dsid.com/persistDepartments ”异常:HTTP状态码 500 内部服务器错误:服务器遇到意外情况,无法完成请求。

7)更多细节:

执行了以下代码。该方法和所有其他方法在 HTTP 分析器中或在单独执行时(使用按钮绑定“persistDepartments”)都可以正常工作,但在 AdfmfJavaUtilities.invokeDataControlMethod 中的包装器中则不行

public void syncDataFromOfflineToOnline() {

      Trace.log(Utility.FrameworkLogger, Level.FINE, this.getClass(), "syncDataFromOfflineToOnline",
              "Executing syncDataFromOfflineToOnline Method");
    try {
        Connection conn = DBConnectionFactory.getConnection();
        conn.setAutoCommit(false);
        PreparedStatement pStmt =
            conn.prepareStatement("SELECT DEPARTMENT_ID, DEPARTMENT_NAME, LOCATION_NAME, STATUS from DEPARTMENTS WHERE STATUS IN (?, ?, ?)");
        pStmt.setString(1, STATUS_NEWLY_CREATED);
        pStmt.setString(2, STATUS_MODIFIED);
        pStmt.setString(3, STATUS_DELETED);
        ResultSet rs = pStmt.executeQuery();
        while (rs.next()) {

            List namesList = new ArrayList(1);
            List paramsList = new ArrayList(1);
            List typesList = new ArrayList(1);


            Departments dept = new Departments();
            dept.setDepartmentId(rs.getInt("DEPARTMENT_ID"));
            dept.setDepartmentName(rs.getString("DEPARTMENT_NAME"));
            dept.setLocationName(rs.getString("LOCATION_NAME"));
            dept.setStatus(STATUS_NOT_CHANGED);


            if (rs.getString("STATUS").equals(STATUS_NEWLY_CREATED)) {
                System.out.println("I got a STATUS_NEWLY_CREATED");
                GenericType gtDept =
                    GenericTypeBeanSerializationHelper.toGenericType("MYWS.Types.persistDepartments.arg0",
                                                                     dept);
                namesList.add("arg0");
                paramsList.add(gtDept);
                typesList.add(Object.class);

                AdfmfJavaUtilities.invokeDataControlMethod("MYWS", null, "persistDepartments", namesList,
                                                           paramsList, typesList);
                //Once the data sync with online, change the status for the row as STATUS_NOT_CHANGED

                PreparedStatement pStmt1 =
                    conn.prepareStatement("UPDATE DEPARTMENTS SET STATUS=? WHERE DEPARTMENT_ID=?");
                pStmt1.setString(1, STATUS_NOT_CHANGED);
                pStmt1.setInt(2, rs.getInt("DEPARTMENT_ID"));
                pStmt1.execute();              
                conn.commit();

                <<< more codes >>>
4

1 回答 1

1

我遇到了这个问题。

将 typesList.add(Object.class) 更改为 typesList.add(GenericType.class)

于 2014-11-13T17:27:44.967 回答