1

java.lang.IllegalAccessExceptionODIsetObject()でonを使用するとスローされますPreparedStatement

私が開発しているもの:ODI(11.1.1)でナレッジモジュールを作成して、別のソースからOracleテーブルにデータをロードします。コードはEclipseで実行すると正常に動作しますが、ODIで実行すると次のエラーが発生します。

-> 他のサイトから入力を取得し、ucp.jar を新しいバージョン 11.2.0.2 に置き換えてみました。README.txt には、このバージョンは IllegalAccessException の既知のバグを解決すると記載されていますが、ODI で実行すると同じエラーに直面します。

Error in method invocation: Cannot access method setObject( int, java.lang.Object ) in 'class oracle.jdbc.driver.OraclePreparedStatementWrapper' :java.lang.IllegalAccessException: Class bsh.Reflect can not access a member of class oracle.jdbc.driver.OraclePreparedStatementWrapper with modifiers "public" : at Line: 433 : in file: inline evaluation of: `` //********Start of OdiSfdcLogger class************** import java.io.File; impor . . . '' : pStatement .setObject ( i + 1 ,( ( Map ) iNotifications .get ( 0 ) ) .get ( sfdcColums .get ( i ) ) ) 
at bsh.BSHMethodInvocation.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHBlock.evalBlock(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BSHForStatement.eval(Unknown Source)
at bsh.BSHSwitchStatement.eval(Unknown Source)
at bsh.BSHBlock.evalBlock(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BshMethod.invokeImpl(Unknown Source)
at bsh.BshMethod.invoke(Unknown Source)
at bsh.BshMethod.invoke(Unknown Source)
at bsh.This.invokeMethod(Unknown Source)
at com.streaming.ck.ConnectOracle.renderData(BeanShell Generated via ASM (www.objectweb.org))
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at bsh.Reflect.invokeOnMethod(Unknown Source)
at bsh.Reflect.invokeObjectMethod(Unknown Source)
at bsh.Name.invokeMethod(Unknown Source)
at bsh.BSHMethodInvocation.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHBlock.evalBlock(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BSHWhileStatement.eval(Unknown Source)
at bsh.BSHBlock.evalBlock(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BSHTryStatement.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.util.BeanShellBSFEngine.eval(Unknown Source)
at bsh.util.BeanShellBSFEngine.exec(Unknown Source)
at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:322)
at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2472)
at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:47)
at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:662)

助言がありますか?

PreparedStatement のコード:

public void renderData(ArrayList notifications, ArrayList sfdcColumnsList, String         oracleColumnsString, String tableName) 
        throws Exception {

    PreparedStatement pStatement = null;
    String eventType = (String)((Map) notifications.get(0)).get("eventType");
    String sql= null;

    switch (typeOfEvent(eventType)) {
    case CREATE:System.out.println("In Created case ---------->");

        sql = "INSERT INTO "+ tableName + "(" +oracleColumnsString+")" + " VALUES (";

            for(int i =0;i<sfdcColumnsList.size()-1;i++){
                sql = sql+"?,";
            }
            sql = sql + "?)";
            System.out.println("SQL QUERY ::::::: "+sql);

            pStatement =  conn.prepareStatement(sql);

            for(int i=0;i<sfdcColumnsList.size();i++){
                String sdfcData =(String) ((Map) notifications.get(0)).get(sfdcColumnsList.get(i));
                System.out.println("Check data :::::: " +sdfcData);
            pStatement.setObject(i+1,((Map)notifications.get(0)).get(sfdcColumnsList.get(i));
                    }

        break;

        //Rest of the cases : 
        }

        try {
        pStatement.setEscapeProcessing(true);
        boolean checkDataconn = pStatement.execute();
        System.out.println("Inserted/updated/deleted record : "+checkDataconn);

    } catch (SQLException e) {
        e.printStackTrace();
    }
4

0 に答える 0