2 Replies Latest reply: Jul 22, 2014 7:20 PM by Razvan Saftescu RSS

    Running the Batch Processor from a Java application

    Razvan Saftescu

      Hello,

       

      Based on an archived thread dealing with the same issue, my understanding is that the main method of com.oracle.determinations.batch.CmdLine has to be run, using a string array as parameter.

       

      Brad Tuckett provided the following syntax pattern:

       

      public static void main(String[] args)

      args is an array of strings matching the command line arguments described in the OPA Developer's Guide topic "Configure the Batch Processor".

       

      But I'm still unable to find a working syntax (after trying many); I always get the error:

       

      FATAL main MAIN - Unsupported configuration option: --config C:/OPA/technical integration/demo projects/ODS - Batch Processor/batch/fraud_score_config.xml

      com.oracle.determinations.batch.exceptions.ConfigurationException: Unsupported configuration option: --config C:/OPA/technical integration/demo projects/ODS - Batch Processor/batch/fraud_score_config.xml

        at com.oracle.determinations.batch.config.CmdLineConfigurationParser.getConfigurationOptions(CmdLineConfigurationParser.java:38)

        at com.oracle.determinations.batch.CmdLine.main(CmdLine.java:70)

        at com.example.batchproject.MainClass.main(MainClass.java:8)

       

       

      The procedure to follow when running the batch processor from the command line being the following:

       

      From the Windows explorer, place yourself in the folder containing the config xml file, open a command prompt (SHIFT+right-click and select 'Open window command here'), write and launch:

      java -jar ../engine/determinations-batch.jar --config fraud_score_config.xml

       

      ... what should then be the exact syntax to use in the Java application?

       

      The following does not work for example:

       

      public static void main(String[] args) {
        String[] argsBatch = new String[1];
        argsBatch[0] = "--config C:/OPA/technical integration/demo projects/ODS - Batch Processor/batch/fraud_score_config.xml";
        com.oracle.determinations.batch.CmdLine.main(argsBatch);
      }
      

       

      Thanks in advance.