Invoke Java Concurrent program from PL/ SQL

Hi Experts,
I 've a requirement to invoke a Java Concurrent program form PL/ SQL. I 've defined default values for some of the parameters in the Java Concurrent program definition and some parameters do not have a default value. I would like to provide only the mandatory attributes that do not have a default value set from my PL/ SQL code. Can you please suggest how this can be achieved?
I tried giving null for those attributes. But, the java program takes a "" value instead of the default values. Any inputs here will be immensely helpful.
Thanks,
Ganapathi

Updating the correct format to be used for reference:
The correct format is:
fnd_request.submit_request(
application => 'PDT_CODE',
program => 'PGM_NAME', --program IN varchar2 default NULL,
start_time=> SYSDATE, --start_time IN varchar2 default NULL,
sub_request => FALSE, --sub_request IN boolean default FALSE
argument1 => rowdata,
argument2 => xxx
Note: the parameter name should be "argument1...n" (and not the actual argument name).
But I noticed that for parameters that are missed out, the default values still do not take effect. Can anyone please confirm this behavior?
Thanks,
Ganapathi

Similar Messages

  • I want to submit a concurrent program from pl/sql. Please help me.

    Dear all,
    I want to submit a concurrent program from pl/sql. But I failed. Please help me.
    Detail:
    I create a concurrent program in 'Cash Management, Vision Operations (USA)' responsibility. <strong>And it be submitted success in EBS</strong>.
    Then
    I create a test script in pl/sql. And use 'FND_GLOBAL.APPS_INITIALIZE' to initialize ebs, then use 'FND_REQUEST.SUBMIT_REQUEST' to submit
    the consurrent program, But the procedure aways return <strong>0</strong>.
    I cannot found the reason. Please help me.Thanks.
    <em>Attached informations may describe the problem:
    1.The concurrenct submitted success in EBS.</em>
    request_id = 4750655 (Sorry, I dont know how to add pictures.)
    <em>2.The initialize informations which from SQL</em>.
    SELECT FCR.REQUESTED_BY USER_ID
    ,FCR.RESPONSIBILITY_ID
    ,FCR.RESPONSIBILITY_APPLICATION_ID
    ,FA.APPLICATION_SHORT_NAME
    ,FCP.CONCURRENT_PROGRAM_NAME
    FROM FND_CONCURRENT_REQUESTS FCR
    ,FND_APPLICATION FA
    ,FND_CONCURRENT_PROGRAMS FCP
    WHERE FCR.PROGRAM_APPLICATION_ID = FA.APPLICATION_ID
    AND FCR.CONCURRENT_PROGRAM_ID = FCP.CONCURRENT_PROGRAM_ID
    AND FCR.REQUEST_ID = 4750655;
    Result: user_id = 1318;
    responsibility_id = 50579;
    application_id = 260;
    application_short_name = 'CE';
    program_short_name = 'CALLK009';
    <em>3.The test script code.</em>
    <p>
    -- Created on 2008/10/22 by ERIC
    declare
    -- Local variables here
    Wv_conc_req_id VARCHAR2(10) DEFAULT NULL;
    BEGIN
    FND_GLOBAL.APPS_INITIALIZE(
    1318
    ,50579
    ,260
    Wv_conc_req_id := FND_REQUEST.SUBMIT_REQUEST(
    'CE'
    ,'CALLK009'
    ,NULL
    ,SYSDATE
    ,FALSE
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    DBMS_OUTPUT.PUT_LINE(Wv_conc_req_id);
    COMMIT;
    end;
    <em>4.The concurrent program code.</em>
    create or replace package body CALLTEST is
    PROCEDURE T1(PvO_errbuf OUT VARCHAR2
    ,PvO_retcode OUT VARCHAR2)
    IS
    BEGIN
    FND_FILE.PUT_LINE(fnd_file.log, 'TEST');
    END;
    end CALLTEST;
    </p>

    Can you check from which schema you are executing FND_REQUEST? You can try as follows;
    Connect to your required schema, create a synonym on apps.fnd_request, connect from apps and finally execute grant all on apps.fnd_request to all.
    You can check for relevance from Doc ID: Note:147495.1
    Please do keep in the mind the soultion above should be applied to a test/dev EBS instance first.
    I hope this would be of help.
    Saad

  • PL/SQL log messages are not printing from Java concurrent program

    Hi,
    I have a strange issue while submitting the Java concurrent program through PL/SQL.
    I have a PL/SQL concurrent program which will invoke the Java concurrent program inside the package by use of "FND_GLOBAL.SUBMIT_REQUEST". It worked and submitted successfully. From that Java concurrent program we are calling some other PL/SQL packages and printing some log messages over there. But problem here is the request is only printing the Java log messages in view log but not the PL/SQL log messages.  But if I submit the Java concurrent program directly from SRS form at that it is printing both Java and PL/SQL log messages.
    I am just wondering how the log messages has not printed. Please provide your inputs to solve this problem.
    Thanks
    Suriya

    I'm adding log messages in the package body , but these messages are not printing after completion of concurrent prog.
    Any suggestions.
    FND_FILE.PUT_LINE(FND_FILE.LOG,'Data Test :');Do you have COMMIT in your code?
    https://forums.oracle.com/forums/search.jspa?threadID=&q=%27FND_FILE.PUT_LINE%27+AND+commit&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Trying to invoking Concurrent Program from BPEL (How to change Resp n WSDL)

    Hi,
    I am trying to invoke a concurrent program from my BPEL process using Oracle Apps adapter. When i am using this adapter, it is not showing the required concurrent program in open interface folder. It showing only few but not one which i am trying to invoke. Can anybody explain me what is the issue with my apps adapter.
    I am using apps schema for adapter.
    Please explain me the below Queries.
    1. Is apps schema enough to configure and get the required concurrent program for adapters?.
    2. After creating apps adapter, in wsdl file it is showing apps user as : SYSTEM and Responsibility as : System Administrator. How can i change this responsibility to the required responsibility whihc can run my concurrent program.
    I am not sure about system administrator responsibility can able to run the required concurrent program.
    Regards,
    Rs.

    First of all does this scenario occur again.
    "Works first/second time. Later gives this error."
    After you restart the SOA server are you able to reproduce this scenario?
    As already pointed out and from the error message, database connection is reset.
    If you find this error again, try this out.
    em -> home / oc4j_soa -> Administration -> JDBC Resources
    Use the "Test Connection" option for the Connection Pool that you are using for your database JNDI.
    It comes back and say "Connection to "XYZCP" established successfully." it is good to use.
    Run the BPEL process again and once you find the error, come back and test the connection.
    If it comes back with Error, diagnose based on the error message received.
    Cheers
    Kalidass Mookkaiah
    http://oraclebpelindepth.blogspot.com/

  • Need to call OAF API from JAVA concurrent program

    Hi Gurus,
    I am trying invoke an OAF Application method which generate the Batch ID. I am trying the invoke the same from JAVA Concurrent program. Below is teh code used,
    package oracle.apps.ego.item.cp;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import oracle.apps.ego.item.common.server.EgoBatchHeader;
    import oracle.apps.ego.item.itemimport.server.EgoImportBatchHeaderAMImpl;
    import oracle.apps.fnd.cp.request.CpContext;
    import oracle.apps.fnd.cp.request.JavaConcurrentProgram;
    import oracle.apps.fnd.cp.request.LogFile;
    import oracle.apps.fnd.cp.request.OutFile;
    import oracle.apps.fnd.cp.request.ReqCompletion;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.ApplicationModuleCreateException;
    import oracle.jbo.ApplicationModuleHome;
    import oracle.jbo.JboContext;
    import oracle.jbo.domain.Number;
    import oracle.jdbc.internal.OracleCallableStatement;
    public class XX_EGO_BATCH_CREATE implements JavaConcurrentProgram {
    static LogFile log = null;
    public void runProgram(CpContext ctx){
    //Obtain the reference to the Output file for Concurrent Prog
    OutFile out = ctx.getOutFile();
    EgoBatchHeader v_header = new EgoBatchHeader();
    //Obtain the reference to the Log file for Concurrent Prog
    log = ctx.getLogFile();
    log.writeln("Batch Number Creation", 0);
    ApplicationModule am = null;
    try{
    //Write your logic here
    log.writeln("Batch Number Creation", 0);
    log.writeln("definition of batch num",0);
    Number batch_num;
    Number ssid = new Number(10000);
    String jdbcUrl =
    "jdbc:oracle:thin:apps/[email protected]:10201:ARERP4";
    ApplicationModule am_Member = null;
    log.writeln("Before Calling Create method",0);
    am_Member =
    create("oracle.apps.ego.item.itemimport.server.EgoImportBatchHeaderAMImpl",
    jdbcUrl);
    log.writeln("assigning ssid"+ssid,0);
    EgoImportBatchHeaderAMImpl bheader = new EgoImportBatchHeaderAMImpl();
    log.writeln("bheader object is :"+bheader,0);
    log.writeln("calling getBatchObjectForCreate"+bheader,0);
    v_header = bheader.getBatchObjectForCreate(ssid);
    //System.out.println("v_header is :" + v_head);
    log.writeln("calling createBatch"+v_header,0);
    batch_num = bheader.createBatch(v_header);
    log.writeln("Batch Number is :"+batch_num ,0);
    out.writeln("This will be printed to the Output File");
    log.writeln("This will be printed to the Log File", 0);
    //Request the completion of this Concurrent Prog
    //This step will signal the end of execution of your Concurrent Prog
    ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL,"Completed.");
    //Handle any exceptional conditions
    catch(Exception e){
    log.writeln("Exception2 occurred here !!"+e,0);
    log.writeln("calling createBatch"+v_header,0);
    public static ApplicationModule create(String amDefName,
    String jdbcConnStr) throws ApplicationModuleCreateException, Exception {
    ApplicationModule am = null;
    try {
    OracleCallableStatement conn = null;
    // Setup the hashtable of JNDI initialization parameters
    log.writeln("inside create method .. ",0);
    Hashtable env = new Hashtable(2);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
    // Create an JNDI initial context
    Context ic;
    ic = new InitialContext(env);
    // Lookup a home interface (factory) for the AppModule by name
    ApplicationModuleHome home =
    (ApplicationModuleHome)ic.lookup(amDefName);
    if(home==null){
    log.writeln("home is null... .",0);
    }else{
    log.writeln("home is not null"+home,0);
    // Create an instance of the AppModule using the home/factory
    am = home.create();
    if(am!=null){
    log.writeln("am is not null"+am,0);
    }else{
    log.writeln("am is null",0);
    // Connect the application module to the database
    am.getTransaction().connect(jdbcConnStr);
    } catch (NamingException ex) {
    log.writeln("NamingException occurred here !!"+ex.getMessage(),0);
    ex.printStackTrace();
    throw new ApplicationModuleCreateException(ex);
    }catch(Exception ex){
    log.writeln("Exception occurred here !!"+ex.getMessage(),0);
    ex.printStackTrace();
    throw new Exception(ex);
    return am;
    I am not able to call the web server and facing issues. Please let me know if you can help me to get a solution to this.
    Thanks in advance
    Veerendra

    Hi Zafar,
    I got an error saying :
    Batch Number Creation
    Batch Number Creation
    definition of batch num
    Before Calling Create method
    inside create method ..
    home is not nulloracle.jbo.server.ApplicationModuleHomeImpl@11d2572
    Jul 9, 2008 5:04:21 AM oracle.adf.share.config.ADFConfigFactory findOrCreateADFConfig
    INFO: oracle.adf.share.config.ADFConfigFactory No META-INF/adf-config.xml found
    Exception occurred here !!JBO-25002: Definition oracle.apps.ego.item.itemimport.server.EgoImportBatchHeaderAMImpl of type ApplicationModule not found
    oracle.jbo.NoDefException: JBO-25002: Definition oracle.apps.ego.item.itemimport.server.EgoImportBatchHeaderAMImpl of type ApplicationModule not found
         at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:441)
         at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:358)
         at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:340)
         at oracle.jbo.server.MetaObjectManager.findMetaObject(MetaObjectManager.java:700)
         at oracle.jbo.server.ApplicationModuleDefImpl.findDefObject(ApplicationModuleDefImpl.java:232)
         at oracle.jbo.server.ApplicationModuleImpl.createRootApplicationModule(ApplicationModuleImpl.java:401)
         at oracle.jbo.server.ApplicationModuleHomeImpl.create(ApplicationModuleHomeImpl.java:91)
         at oracle.apps.ego.item.cp.XX_EGO_BATCH_CREATE.create(XX_EGO_BATCH_CREATE.java:139)
         at oracle.apps.ego.item.cp.XX_EGO_BATCH_CREATE.runProgram(XX_EGO_BATCH_CREATE.java:57)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    Exception2 occurred here !!java.lang.Exception: oracle.jbo.NoDefException: JBO-25002: Definition oracle.apps.ego.item.itemimport.server.EgoImportBatchHeaderAMImpl of type ApplicationModule not found
    calling [email protected]9c

  • How to call a BPEL process from Oracle Apps Java Concurrent program

    Hello,
    I need to trigger a BPEL process from Oracle Apps. Can anybody tell me how to do that? I have two triggering option--
    1. On button click from a Form 6i screen
    2. Using Java Concurrent program.
    Thanks in advance.
    Debkanta

    I am not sure how concurrent program works, but may be one of the way might work out, let me know if Java Concurrent Program works a bit different way
    - [if async] Through concurrent program, you can insert message token to db or aq, and BPEL can be instantiated from there
    or
    - If it supports pure java call, then you can look at multiple documents (e.g. http://www.oracle.com/technology/products/ias/bpel/pdf/orabpel-Tutorial7-InvokingBPELProcesses.pdf) to invoke your process
    - You can also use oracle db utility to invoke soap operation and get the result back
    HTH,
    Chintan

  • Java Concurrent Program - connecting to MS SQL Server

    Hi,
    I hope this is correct forum to post this question.
    I am writing a JCP which will connect to a MS SQL Server DB, pull data from a table and populate this data into a custome table in EBS (R12.1.1) database. But I am facing some issues.
    When I run run this concurrent program from EBS, I get following exception message:
    Wed Aug 08 01:18:04 GMT 2012: In openConection()
    Wed Aug 08 01:18:04 GMT 2012: Before Loading Driver com.microsoft.jdbc.sqlserver.SQLServerDriver
    Wed Aug 08 01:18:04 GMT 2012: openConection() ClassNotFoundException: java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
    Wed Aug 08 01:18:04 GMT 2012: Before Calling processPrintMachineRecords()
    Wed Aug 08 01:18:04 GMT 2012: Exception:: java.lang.NullPointerException
    Wed Aug 08 01:18:04 GMT 2012: In closeSQLServerConnection().......closing JDBC Connection
    Wed Aug 08 01:18:04 GMT 2012: Connection object was null, hence skipping close
    Wed Aug 08 01:18:04 GMT 2012: After Calling processPrintMachineRecords()
    The I read somewhere on internet that I should set CLASSPATH in options field of concurrent program definition. So I provided classpath as follows:
    -cp /rs01/u02/applmgr/utyeb02/apps/apps_st/appl/au/12.0.0/appsborg.zip:/rs01/u02/applmgr/utyeb02/apps/apps_st/comn/java/classes/apps.zip:/rs01/u02/applmgr/utyeb02/apps/apps_st/comn/java/classes/sqljdbc_4.0/enu/sqljdbc.jar
    In this classpath sqljdbc.jar contains the classes for connecting to MS SQL Server DB. However after giving classpath like this I started getting different error:
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/apps/fnd/cp/request/Run
    Caused by: java.lang.ClassNotFoundException: oracle.apps.fnd.cp.request.Run
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    It appears from the error message that after giving this CLASSPATH, program was not able to find the "Run" method itself. In otherwords, CLASSPATH screwed it further.
    Can anybody please point out what am I doing wrong here?
    Regards
    Java Code:
    package oracle.apps.custom.printmachine;
    import java.sql.*;
    import oracle.apps.fnd.cp.request.* ;
    import java.io.*;
    import oracle.apps.fnd.util.*;
    public class PrintMachineInterface implements JavaConcurrentProgram {
    public static final String M_SUCCESS = "SUCCESS";
    public static final String M_ERROR = "ERROR";
    public static final String M_WARNING = "WARNING";
    int mRequestStatus = -1;
    int max_number_of_records = 99999999;
    private String mSqlServerHost = "mysqlserver.domain.com";
    // Application Short Name
    private String applName;
    CpContext mCtx;
    LogFile logFile;
    OutFile outFile;
    Connection mConn = null;
    ReqCompletion lRC;
    public PrintMachineInterface(){
    // if no parameter value is specified for APPLNAME then use FND
    //as default value
    applName = "FND";
    private void logMessage(String str) {
    java.util.Date now = new java.util.Date();
    logFile.writeln(now.toString() + ": " + str, LogFile.STATEMENT);
    static String mInsertRecord = " Declare " + " BEGIN "
    + " INSERT INTO XXGFN_GBL_CE_PM_STAGE(ID, KEY, FILENAME, PRINTED_AT, CREATED_AT, DOCTYPE, LANGUAGE, OU, TRX_ID, DOC_ID, REQ_ID, TEMPLATE, PAGES, DOC_TEXT, TIMES_RECEIVED)"
    + " VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, substr(:14,2000), :15);"
    + " COMMIT;"
    + " END;";
    static Connection con = null;
    public void openConection() {
    logMessage( "In openConection()");
    try {
    logMessage( "Before Loading Driver com.microsoft.jdbc.sqlserver.SQLServerDriver");
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    logMessage( "After Loading Driver com.microsoft.jdbc.sqlserver.SQLServerDriver");
    logMessage( "Attempting to connect to " + mSqlServerHost);
    con = DriverManager.getConnection("jdbc:microsoft:sqlserver://" + mSqlServerHost + ":1433;User=sql_user;Password=sql_pwd");
    logMessage( "After con assigned from getConnection(jdbc:microsoft:sqlserver://" + mSqlServerHost + ":1433;User=pm_dba_access;Password=*****");
    } catch (java.lang.ClassNotFoundException e) {
    logMessage("openConection() ClassNotFoundException: " + e);
    } catch (SQLException ex) {
    logMessage("openConection() SQLException: " + ex);
    public void closeSQLServerConnection() {
    try {
    logMessage( "In closeSQLServerConnection().......closing JDBC Connection");
    if (con != null)
    logMessage( "Con is not null");
    con.close();
    logMessage( "Con Closed Successfully");
    else
    logMessage( "Connection object was null, hence skipping close");
    } catch (SQLException ex) {
    logMessage("SQLException: " + ex);
    } catch (Exception ex) {
    logMessage("Exception in closeSQLServerConnection() : " + ex);
    private void populate_staging_table(
    String p_id,
    String p_key,
    String p_filename,
    String p_printed_at,
    String p_created_at,
    String p_doctype,
    String p_language,
    String p_ou,
    String p_trx_id,
    String p_doc_id,
    String p_req_id,
    String p_template,
    String p_pages,
    String p_doc_text,
    String p_times_received
    PreparedStatement lStmt = null;
    logMessage("Populating data from PrintMachine history table");
    try {
    lStmt = mConn.prepareCall(mInsertRecord);
    lStmt.setString(1, p_id);
    lStmt.setString(2, p_key);
    lStmt.setString(3, p_filename);
    lStmt.setString(4, p_printed_at);
    lStmt.setString(5, p_created_at);
    lStmt.setString(6, p_doctype);
    lStmt.setString(7, p_language);
    lStmt.setString(8, p_ou);
    lStmt.setString(9, p_trx_id);
    lStmt.setString(10, p_doc_id);
    lStmt.setString(11, p_req_id);
    lStmt.setString(12, p_template);
    lStmt.setString(13, p_pages);
    lStmt.setString(14, p_doc_text);
    lStmt.setString(15, p_times_received);
    lStmt.execute();
    lStmt.close();
    } catch (SQLException s) {
    logMessage("Exception thrown w/ error message: "
    + s.getMessage());
    s.printStackTrace();
    finally {
    try {
    if (lStmt != null)
    lStmt.close();
    } catch (SQLException e) {
    logMessage("SQLException: " + e);
    private void processPrintMachineRecords() {
    int number_of_recs = 0;
    try {
    PreparedStatement stmt = con.prepareStatement("SELECT TOP 1000 ID, Key, Filename, PrintedAt, CreatedAt, Doctype, Language,OU, TransactionID, DocumentID, RequestID, Template, Pages, Documenttext, TimesReceived FROM PM_DATA.dbo.History" );
    ResultSet rst = stmt.executeQuery();
    while (rst.next()) {
    number_of_recs++;
    if (number_of_recs == max_number_of_records) break;
    populate_staging_table(
    rst.getString(1), rst.getString(2)
    ,rst.getString(3), rst.getString(4)
    ,rst.getString(5), rst.getString(6)
    ,rst.getString(7), rst.getString(8)
    ,rst.getString(9), rst.getString(10)
    ,rst.getString(11), rst.getString(12)
    ,rst.getString(13), rst.getString(14)
    ,rst.getString(15)
    stmt.close();
    rst.close();
    mConn.commit();
    } catch (SQLException ex) {
    logMessage("SQLException: " + ex);
    catch (Exception ex) {
    logMessage("Exception:: " + ex);
    closeSQLServerConnection();
    public void runProgram(CpContext pCpContext) {
    applName = "XXGFN";
    String l_file_path = null;
    mCtx = pCpContext;
    //get handle on request completion object for reporting status
    lRC = pCpContext.getReqCompletion();
    // assign logfile
    logFile = pCpContext.getLogFile();
    // assign outfile
    outFile = pCpContext.getOutFile();
    // get the JDBC connection object
    mConn = pCpContext.getJDBCConnection();
    l_file_path = ((new File(outFile.getFileName())).getParent() == null ? ""
    : (new File(outFile.getFileName())).getParent());
    // get parameter list object from CpContext
    ParameterList lPara = pCpContext.getParameterList();
    while (lPara.hasMoreElements())
    NameValueType aNVT = lPara.nextParameter();
    if ( aNVT.getName().equals("APPLNAME") )
    applName = aNVT.getValue();
    /** openConection() Opens the connection to SQL Server Database*/
    openConection() ;
    logMessage("Before Calling processPrintMachineRecords()");
    processPrintMachineRecords();
    logMessage("After Calling processPrintMachineRecords()");
    try{
    setCompletion(ReqCompletion.NORMAL, "Request Completed Normal");
    } catch (Exception e) {
    setCompletion(ReqCompletion.ERROR, e.toString());
    } finally {
    pCpContext.releaseJDBCConnection();
    * Sets the request completion status based on proper precedence. ERROR >
    * WARNING > NORMAL
    * @param pStatus
    * Status of the request.
    * @param pCompletionText
    * Request's completion text.
    public void setCompletion(int pStatus, String pCompletionText) {
    if ((pStatus == ReqCompletion.ERROR)
    || ((pStatus == ReqCompletion.WARNING) && (mRequestStatus != ReqCompletion.ERROR))
    || ((pStatus == ReqCompletion.NORMAL)
    && (mRequestStatus != ReqCompletion.WARNING) && (mRequestStatus != ReqCompletion.ERROR))) {
    mRequestStatus = pStatus;
    lRC.setCompletion(pStatus, pCompletionText);
    }

    ok
    i used Template.java as input
    useful MOS:
    How To Create a Java Concurrent Program? [ID 827563.1]
    Java Concurrent Program FAQ [ID 827575.1]
    i used
    //goto ms sql server 2008r2       
            try{
             Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");        
             con = java.sql.DriverManager.getConnection( 
                                          "jdbc:sqlserver://1.2.3.4:1433;databaseName=test;selectMethod=cursor", 
                                          "test", "test");          
              if(con!=null) System.out.println("Connection Successful!");
            }catch(Exception e){
              e.printStackTrace();
              System.out.println("Error Trace in getConnection() : " + e.getMessage());
            }1.2.3.4 - ip of instance with sqlserver2008r2 :)
    in your code
    >
    try {
    logMessage( "Before Loading Driver com.microsoft.jdbc.sqlserver.SQLServerDriver");
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    logMessage( "After Loading Driver com.microsoft.jdbc.sqlserver.SQLServerDriver");
    logMessage( "Attempting to connect to " + mSqlServerHost);
    con = DriverManager.getConnection("jdbc:microsoft:sqlserver://" + mSqlServerHost + ":1433;User=sql_user;Password=sql_pwd");
    logMessage( "After con assigned from getConnection(jdbc:microsoft:sqlserver://" + mSqlServerHost + ":1433;User=pm_dba_access;Password=*****");
    } catch (java.lang.ClassNotFoundException e) {
    logMessage("openConection() ClassNotFoundException: " + e);
    } catch (SQLException ex) {
    logMessage("openConection() SQLException: " + ex);
    >
    try my case for Driver and Connection
    put result .class file to needed directory
    put sqljdbc4.jar to /rs01/u02/applmgr/utyeb02/apps/apps_st/comn/java/lib
    and for concurrent program option
    -classpath /rs01/u02/applmgr/utyeb02/apps/apps_st/comn/java/classes:/rs01/u02/applmgr/utyeb02/apps/apps_st/appl/au/12.0.0/appsborg.zip:/rs01/u02/applmgr/utyeb02/apps/apps_st/comn/java/lib/sqljdbc4.jaralso useful mos:
    Classpath Setting of Third Party Jar Files in R12 Java Concurrent Program (JCP) [ID 1292694.1]

  • How to Invoke Extensions in Java Concurrent Programs - Urgent

    hi all,
    can any one help me in understanding how to invoke Extensions (attached to Rules) in Java Concurrent Programs (part of autoconfig)
    it is migration task from FC to Extensions
    Please suggest
    thanks,
    Srikanth

    if you want to invoke the rule, that triggers the Extension, create a rule which invoke the rule, like "ALWAYS TRUE" REQ Extension. Then as soon as the Model in instaniated, the Extension will be executed.

  • How can i get the source code from java concurrent program in R12

    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    Zulqarnain

    user570667 wrote:
    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    ZulqarnainDid you see old threads for similar topic/discussion? -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Java+AND+Concurrent+AND+Source+AND+Code&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Calling Web service from Java Concurrent Program

    Hi,
    I created a Java concurrent program and created executable. Here is my code.
        public void runProgram(CpContext ctx) {
            String value = "Java Concurrent Program Testing";
            Hello hell = new Hello();
            String returnValue = hell.testURL(value);
            if(returnValue.equalsIgnoreCase("TRUE")){
                ctx.getLogFile().writeln("-- Java Concurrent Program Testing --", 0);
                ctx.getOutFile().writeln("-- Java Concurrent Program Testing --");
                ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, "");
            else{
                ctx.getLogFile().writeln("-- Hello World! --", 0);
                ctx.getOutFile().writeln("-- Hello World! --");
                ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, "");
        }testURL() call the web service and get the response. but when I am selecting View Output option I am always geting out put as
    -- Hello World! --I tested the logic of calling web service. It giving me out put "true". Here is my Web service calling code
        public String testURL(String Value){
            HttpURLConnection httpConn = null;
            ByteArrayOutputStream bout = null;
            String setWebServiceURLResponse = "";
            String responseString="";
            String outputString = "";
            try{
                httpConn = getHttpConnection();
                bout = new ByteArrayOutputStream();
                String xmlInput = soapBodyStart +
                "<ns1:getTestURL>\n" +
                "            <ns1:URL>"+Value+"</ns1:URL>\n" +
                "        </ns1:getTestURL>"+
                soapBodyEnd;
                byte[] buffer = new byte[xmlInput.length()];
                buffer = xmlInput.getBytes();
                bout.write(buffer);
                byte[] b = bout.toByteArray();
                httpConn = setHttpConnectionRequest(b,httpConn);
                //Read the response.
                InputStreamReader isr = new InputStreamReader(httpConn.getInputStream());
                BufferedReader in = new BufferedReader(isr);
                //Write the SOAP message response to a String.
                while ((responseString = in.readLine()) != null) {
                    outputString = outputString + responseString;
                //Parse the String output to a org.w3c.dom.Document and be able to reach every node with the org.w3c.dom API.
                Document document = parseXmlFile(outputString);
                String formattedSOAPResponse = formatXML(outputString);
                System.out.println("Formatted response = \n" +formattedSOAPResponse);
                //NodeList nodes = document.getElementsByTagName("setWebServiceURLResponse");
                //NodeList nodes = document.getElementsByTagName("getTestURLResponse");
                 NodeList nodes = document.getElementsByTagName("ns0:getTestURLResponse");
                int len = nodes.getLength();
                System.out.println("Inside testURL Node Lenght  = "+ len);
                for(int s=0; s<nodes.getLength() ; s++){
                    Node authenticateResultNode = nodes.item(s);
                    if(authenticateResultNode.getNodeType() == Node.ELEMENT_NODE){
                        Element authenticateResultElement = (Element)authenticateResultNode;
                        //NodeList authenticateResultValueNode = authenticateResultElement.getElementsByTagName("ns0:return");
                        //NodeList authenticateResultValueNode = authenticateResultElement.getElementsByTagName("return");
                         NodeList authenticateResultValueNode = authenticateResultElement.getElementsByTagName("ns0:return");
                        Element authenticateResultValue = (Element)authenticateResultValueNode.item(0);
                        NodeList textFNList = authenticateResultValue.getChildNodes();
                        //System.out.println("Authenticate Result : " + ((Node)textFNList.item(0)).getNodeValue().trim());
                         setWebServiceURLResponse = ((Node)textFNList.item(0)).getNodeValue();
                         //System.out.println("Authenticate Response in getAuthenticate method : " + authenticateresponse);
                    }//end of if clause
                }//end of for loop with s var
                System.out.println("Inside setWebServcieURLToFile response = " + setWebServiceURLResponse);
            catch(Exception e){
                e.printStackTrace();
            return setWebServiceURLResponse;
        }Where I am going wrong ?
    Regards,
    Ajay Sharma

    sample code:
    static string url = "http://my.webservice.url"; ---------------> The actual web service URL
    Call = new Call(url); --------------------------------------------------> The call object used by JAX-RPC
    Object[] params = new Object[]{param1, param2};---------> build the call parameters
    Boolean/Integer/Whatever result = call.invoke("method name", params);------>call the invoke method to get the result

  • Cal plsql pkg from Java concurrent program

    Hi,
    I try to execute one plsql pkg inside a java concurrent pgm.plsql code executed from view output i got the out put.Bt my status Shows ERROR.
    this is my code
    try{
    System.out.println("transation type inside try block "+deptno);
    CallableStatement cs=con.prepareCall("{call XX_ANE_DEPT2_PKG.XX_ANE_DEPT2_PRC(?,?,?)}");
    cs.setString(1,null);
    cs.setString(2,null);
    cs.setString(3,deptno);
    cs.execute();
    con.commit();
    cs.close();
    //LF.writeln("Generating Programs for Application : " + transactionType, LogFile.STATEMENT);
    //OF.writeln( " Available Concurrent Programs for Application " +transactionType );
    catch(SQLException ex){
    lRC.setCompletion(ReqCompletion.ERROR, ex.toString());
    finally
    pCpContext.releaseJDBCConnection();
    I dont knw why the status is error any one pls help.If it is wrong method any one pls give a sample pgm to cal a PKG in concurrent pgm.
    pls help
    Edited by: aneeshmathew on Dec 28, 2010 4:49 AM
    Edited by: aneeshmathew on Dec 28, 2010 4:49 AM

    Are you able run this concurrent program from form application.? if it erroring out there what error you are getting.
    Thanks

  • How to run another concurrent from Java Concurrent Program?

    Hi,
    I have one Java Concurrent Program in ebs R12.
    I need to run another Java Concurrent Program when first finished.
    I can not find a way to start another request from JCP.
    Thanks,
    ms

    Hi ,
    this is an example code to check the OS before running the command :
    try{
    int ch;
    Process proc ;
    Runtime r=Runtime.getRuntime();
    StringBuffer sbuf = new StringBuffer();
    String dir = new String();
    String osname = System.getProperty("os.name");
    if(osname.equals("Windows NT") )
    proc = r.exec("cmd /c dir");
    if(osname.startsWith("Linux") )
    proc = r.exec("df -k");
    InputStream is = proc.getInputStream();
    while((ch=is.read() ) != -1)
    sbuf.append((char)ch);
    is.close();
    dir = sbuf.toString();
    System.out.println(dir );
    }catch(Exception e){ System.out.println(e.getMessage());}
    bye
    Taha

  • Calling java program from PL/SQL code

    Dear,
    How to develop and call a java program from PL/SQL code?
    What about if this program will call other java programs?

    Perhaps the Java Developer's Guide would be a good place to start
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14187/toc.htm
    Justin

  • Error finding/creating AM from Java Concurrent Program

    Hi All,
    Here is what I am attempting to do in a Java concurrent program
    --------------- Code Start - Error description in the code snippet comments ---------------
    public void runProgram(CpContext pCpContext)
    DBTransactionImpl mDBTransactionImpl
    = new DBTransactionImpl(pCpContext.getJDBCConnection());
    OAApplicationModule am = null;
    // At this point I tried to call various methods on DBTransactionImpl
    // And each method call, causes the CP to error with a different exception
    // Calling findApplicationModule() causes the following exception
    // java.lang.NullPointerException
    // at oracle.jbo.server.DBTransactionImpl.findApplicationModule(DBTransactionImpl.java:4840)
    // at xxicon.oracle.apps.xbol.pa.cp.XXIconImportUnitsFrmXls.runProgram(XXIconImportUnitsFrmXls.java:101)
    // at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
    am = mDBTransactionImpl.findApplicationModule(IMPORT_UNITS_AM_INS);
    // Calling createApplicationModule() causes the following exception
    // java.lang.NullPointerException
    // at oracle.jbo.server.DBTransactionImpl.createApplicationModule(DBTransactionImpl.java:4954)
    // at xxicon.oracle.apps.xbol.pa.cp.XXIconImportUnitsFrmXls.runProgram(XXIconImportUnitsFrmXls.java:109)
    // at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
    am = mDBTrx.createApplicationModule( IMPORT_UNITS_AM_INS
         ,IMPORT_UNITS_AM_DEF);
    // Calling isConnected() causes the following exception
    // java.lang.NullPointerException
    // at oracle.jbo.server.DBTransactionImpl.isConnected(DBTransactionImpl.java:4335)
    // at xxicon.oracle.apps.xbol.pa.cp.XXIconImportUnitsFrmXls.runProgram(XXIconImportUnitsFrmXls.java:65)
    // at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
    if (mDBTransactionImpl.isConnected())
    // Log the fact that DBTrx is connected
    --------------- Code End - Error description in the code snippet comments ---------------
    Would someone be kind enough to tell me what is it that I am doing wrong here?
    Thanks a ton!
    KH
    Message was edited by: Kiran
    kiran.k.hegde

    Kiran,
    How did you convert/cast the CpContext into an AppsContext to supply to createRootAM?
    Would you maybe share some more code?
    Update
    No need for that, a simple
    public void runProgram( CpContext ctx )
    String amName;
    String methodName;
    OAApplicationModuleFactory amF = new OAApplicationModuleFactory();
    OAApplicationModule am = amF.createRootOAApplicationModule( ctx, amName );
    am.invokeMethod( methodName );
    will do...
    Message was edited by:
    TyskJohan

  • Java Concurrent Program .class file location

    Hi frnds,
    I need to know the .class file location of a java concurrent prog. I know the filename from concurrent program executables and my concurrent program filepath is oracle.apps.xxogl.f04.cp.file. But I dont know where the exact location of the file is. pls help me.
    I searched for the same and found the following article in many places which doesnt seem to help me much.
    http://geektalkin.blogspot.com/2008/03/oracle-apps-java-concurrent-program.html
    pls help. thanks in advance.
    Lisan

    Hi;
    pls file can be found like
    /apps_st/appl/bom/12.0.0/patch/115/sql/
    Contains SQL*Plus scripts used to upgrade data, and .pkh, .pkb, and .pls scripts to create PL /SQL stored procedures.
    Regard
    Helios

Maybe you are looking for