Running the Batch Processor from a Java application (on schedule)

Hello,
I would like to run the Batch Processor (on schedule) from a Java application -- not from the Command Prompt.
To achieve that, I suppose I would need to call a certain function contained in engine/determinations-batch.jar, using perhaps the path to the config xml as an argument.
The trouble is that the OPA developer's guide doesn't mention it (or at least I didn't find it).
Could you help me out?
Thanks in advance.
Razvan

RazvanSaftescu wrote:
Thanks Frank, but is there a way to identify this method and its syntax? I didn't find anything so far on the internet or on the dev's guide.
This is the Java main method for the determination-batch.jar file - so the main method has the syntax:
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".
Regards,
Brad

Similar Messages

  • Can we run the batch file using simple java application

    Hello sir,
    we want to run the batch file using simple java application. i tried with some example, we run the exe files but not batch file.
    Runtime r = Runtime.getRuntime();
    r.exec("D:\\jboss\\bin\\run.bat");
    My application is server will run when we run the java appliation.
    any suggestion? plz give me the solutions

    yes you can run html file
    WEB.SHOW_DOCUMENT is a built-in that is used in Forms to call URL from a Web Form. It works much like the similar way that a link on an HTML page works and it takes two arguments, one is URL and second one is TARGET, in your case use following.
    WEB.SHOW_DOCUMENT('http://channas.iil.informatics.lk:8890/forms/frmservlet?config=abc.html', '_blank');
    Hope this will work for you
    Abbas

  • Running a dos command from a java application

    hello,
    I'm trying to execute a batch file from a java application. I tried with:
    try
    Process proc=Runtime.getRuntime().exec("fop -fo "+iXmlFoFile+" -
    svg "+SvgFileName);
    }catch (IOException e){System.err.println("Error in conversion of
                               the Xml FO file into Svg file: "+e);}
    and with:
    try
    Process proc=Runtime.getRuntime().exec("cmd ./c fop
    -fo "+iXmlFoFile+" -svg "+SvgFileName);
    }catch (IOException e){System.err.println("Error in conversion of
                the Xml FO file into Svg file: "+e);}
    but i have a IOException: CreateProcess: .... error=2
    When I try these line to launch a .exe file it works but not with a .bat file.
    I also tried:
    String execstr = "fop -fo "+iXmlFoFile+" -svg "+SvgFileName;
    String [] commandArray = { execstr };
    try {
    Runtime.getRuntime().exec(commandArray);
    } // end try
    catch ( Exception e ) {
    System.out.println( e.getMessage() );
    e.printStackTrace();
    }// end catch
    but i got the same exception in java.lang.Win32Process.create
    What did i do wrong?

    Your execution string is a bit more that I want to figure out, but here are a couple ideas:
    Is the working directory of any importance? If so you'll need to set that when you do your exec()
    I think I remember reading something about batch files that couldn't be kicked off via this method. Perhaps you need to execute the string "start mybatchfile.bat". Seems like you need to do something like that to get a command interpreter to run your batch file.

  • Running a Unix script from a Java class

    I am trying to use SCP (Secure copy) to copy an xml file from my J2EE application to a remote Unix server using a Unix script. How can I run the Unix script from my Java class? I could not find any resource for this on the internet. Can someone help me with this please.
    Thanks

    I am trying this below program ,but i am getting the error please help me
    import com.jcraft.jsch.*;
    import com.jcraft.jsch.Channel;
    import com.jcraft.jsch.JSch;
    //import com.jcraft.jsch.JSchException;
    import com.jcraft.jsch.Session;
    //import com.jcraft.jsch.UserInfo;
    import java.io.*;
    public class testrad {
    public static void main(String args[])
    String user="usertvr";
    String host="5.34.12.1";
    String cmd="ls -l";
    JSch jsch = new JSch();
    try{
    Session session=jsch.getSession(user,host,22);
    session.setPassword("$yhaj23");
    //UserInfo usrInfo=new MyUserInfo();
    //session.setUserInfo(usrInfo);
    session.connect();
    Channel channel=session.openChannel("exec");
    ((ChannelExec) channel).setCommand(cmd);
    channel.setXForwarding(true);
    channel.connect();
    //code
    channel.setInputStream(System.in);
    // channel.setOutputStream(System.out);
    //((ChannelExec) channel).setErrStream(System.err);
    InputStream in = channel.getInputStream();
    channel.connect();
    byte[] tmp = new byte[1024];
    while (true)
    while (in.available() > 0)
    int i = in.read(tmp, 0, 1024);
    if (i < 0)
    break;
    System.out.print(new String(tmp, 0, i));
    if (channel.isClosed())
    in.close();
    // System.out.println("JSCH: exit-status: " +
    //channel.getExitStatus());
    break;
    try
    Thread.sleep(1000);
    catch (Exception ee)
    channel.disconnect();
    session.disconnect();
    }catch(Exception e)
    {e.printStackTrace();
    System.out.println("Exception"+e);}
    /*public static class MyUserInfo implements UserInfo {
    public String getPassword()
    { return "password"; }
    public String getPassphrase()
    { return ""; }
    public boolean promptPassword(String arg0)
    { return true; }
    public boolean promptPassphrase(String arg0)
    { return true; }
    public boolean promptYesNo(String arg0)
    { return true; }
    public void showMessage(String arg0)
    Here is the error
    com.jcraft.jsch.JSchException: UnknownHostKey: 5.128.0.10. RSA key fingerprint is 02:a0:d6:c0:6f:69:2c:a9:a7:fa:7c:71:1c:60:ed:57
         at com.jcraft.jsch.Session.checkHost(Unknown Source)
         at com.jcraft.jsch.Session.connect(Unknown Source)
         at com.jcraft.jsch.Session.connect(Unknown Source)
         at testrad.main(testrad.java:23)
    Exceptioncom.jcraft.jsch.JSchException: UnknownHostKey: 5.128.0.10. RSA key fingerprint is 02:a0:d6:c0:6f:69:2c:a9:a7:fa:7c:71:1c:60:ed:57
    Can some one help me please.
    I running this program from Windows to connect to remote unix boxes.

  • Starting weblogic server from a java application

    Hello,
    I am trying to start the weblogic server from a java application i wrote.
    the code:
    Process p=null;
    try{
    p= Runtime.getRuntime().exec("cmd /c c:/startWeblogic.cmd");
    catch (Exception e)\[
    this doesn't start the weblogic... Using the same line to start other types of files does work... only file with the extention of cmd i can't run.
    I even tried to write a bat file that calls the cmd file but it still does't work.
    Can someone help?
    THANKS!!!
    P.S.
    The Java application I used implement the SysTrayMenuListner - can this be the problem?

    no - nothing happened. it perform the next java code - and there is nothing else happen on the windows.
    maybe i don't check in the right place for the error you are talking about?
    i also tried i simple cmd file that does nothing - but still nothing...
    for any other file types it works properly.

  • How can access MS Outlook Calender information  from my Java application.

    People schedule meeting with some data on regular basis.
    I need to access the Exchange server from my Java application and get the meeting dates along with other data pertaining to meeting.

    I had the same problem, and I dont think (as far as my knowledge goes) there is any freeware that will enable Java to access Exchange server. But there are some commercial products that are available.
    Chk this link as an example: http://www.compoze.com/products_hme_desc.html
    good luck in the research
    -kms

  • Is it possible to create triggers in sybase from jdbc (java application)?

    We are in the need to create a triggers in the database (sybase) from JDBC (java application)?
    Please send me pointers or articles related to this.
    Thanks in advance,
    Kri

    A trigger is NEVER explicitly called, from any environment.
    It is implicitly called when you invoke the operation that it's a trigger for.
    Whether you're using Java or anything else to invoke that operation makes no difference whatsoever.

  • URGENT:- Running a batch file from java program

    Author: pkanury
    I am trying to execute a batch file from my java program using RunTime and Process . It can execute any dos command except for a batch file. Can anyone throw
    some light ?? My code looks like this .....
    cmd = "command.com /c X:\\grits\\scripts\\test.bat"; Runtime rt = Runtime.getRuntime(); Process p = rt.exec(cmd);
    The weird part is that p.waitFor() returns a status of 0 implying that the cmd has been executed successfully. But that is not the case. And my batch file is as simple as - type "ADADA" > junk.txt
    Any help would be appreciated.

    I think it should work when you use a String[] array
    instead of a single String:
    String[] cmd = { "command.com", "/C", "D:\\batch\\do.bat" };
    Note: If the batchfile creates any output (i.e. files),
    they will be stored in the directory of the application
    which calls the batch file, not in d:\batch\...

  • HT5568 Will the new update uninstall any Java applications I am currently running?

    Will the new update uninstall any Java applications I am currently running?

    Safari?  Removing your existing Java applications?  No.  That won't happen.
    What will happen is the Java run-time and the Java plug-ins that were part of Safari.  You will be using the Oracle web site, and you'll be downloading and configuring and operating and managing the Java environment and the Java plug-ins for Safari and other browsers more directly, and usually with downloads from Oracle.
    Apple deprecated Java a while back, and they're now finishing the work and the transition of support over to the folks at Oracle, and of securing OS X from attacks against stale versions of Java.

  • Run remote batch file from Web Application Server

    Hello,
    I've developyed a Java program and deployed it on WAS v7.1.
    My java program tries to run a remote batch file which is located on remote Windows file system (and not on the WAS file system itself).
    The batch file was launched on the remote server (I saw it on the Task Manager of the remote server), but the remote batch file actually wasn't run (it was stuck).
    In order to run the remote batch file from my java program that is deployed on the WAS I've created a batch file on the WAS file system which its contnet is:
    cd c:\jobs
    psexec.exe 
    iltlvt40 -u SAPServiceCE1 -p a2i2000! c:\automation\DiskSpace\runDiskSpace.bat
    The jobs folder contains the psexec.exe file (you can find more details about the psexec on this link: http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx).
    iltlvt40 is the remote server.
    SAPServiceCE1/a2i2000! is a user/password on the remote server which has a full permissions.
    My java program calls this batch file using the Runtime.exec() java method in order to run the remote batch file.
    Please guide me how to solve this problem?
    Best regards,
    Ahmad

    Hi,
    To which batch file you have meant to add some commands: for the local one or remote?
    I've added to the local one some different commands and it's works.
    I think there is a permission problem when we are trying to go out of the WAS file system.
    Best regards,
    Ahmad

  • Can we control the top level navigation in portal from a java application

    Hello,
    I am having a scenario where User logged in to portal and assigned with 2 roles (HOME , ISA(Java application)). When user opened a form in ISA (Java application) and tried to enter the data in form and moved to another tab (e.g. HOME) in top level navigation.
    When user come back to ISA (Java application) TAB , we show the page where he left earlier. I would like to know if user click any other TAB in top level navigation (Role assigned to him) while working on a page in ISA(Java application) is there any way we can catch that event before he leaves from ISA (Java application JSP page) to other TAB?
    How can we control the top level navigation events in the portal from a java application .Since Top level navigation is seperate par file.
    Thanks,
    RN

    Dear Rajesh,
    Top Level and detailed navigation values comes with iteration in the respective par file.
    Please check the par file and based on the value (i.e tab name) selected, you can write your code.
    Best Regards
    Arun Jaiswal

  • How to run the perl script from java ?

    Hi , I need to run the pearl script from the server and to get the result of the script thro' java using SSH
    Is there any 3rd party SSH API in java ?
    Please help me out
    thanks in advance
    karthik

    This seems like a very strange thing to want to do.
    What is the perl script doing?
    Do other programs (not some shell script) access this server-side perl script from a different machine?
    If so how do they do it?
    What currently triggers the perl script to execute?
    What currently handles the output from the perl script?
    If you can answer these questions (and understand the answers) you should be able to come up with a different approach to this.
    You do not really want to call a remote perl script from a Java program, you want to achieve the effect you think that would have if you could do it.
    So find the answers to the above questions, write them on 3" x 5" cards and lay them out on your desk.
    What flow of control needs to happen? Which piece of code needs to produce or consume which piece of data?
    If that fails, ask you self or who ever is making you do this what are the use-cases?
    If you do not know what use-cases are or do not understand them well enough try reading
    Use Case Modeling (The Addison-Wesley Object Technology Series) by Kurt Bittner and Ian Spence (Paperback - Aug 30, 2002)
    http://www.amazon.com/s/ref=nb_ss_gw/002-7908514-4043267?url=search-alias%3Dstripbooks&field-keywords=use+cases&x=0&y=0
    It is a short and easy to read book on the subject and also one of the best.
    You MUST understand WHAT you are trying to achieve before you can decide HOW you are going to achieve it.

  • How run a batch file from VBS script?

    I have written a script in which I create a batch file that I want to run. Running it from the Start menu with "Run..." works fine but I would like to do it automatically from the script. I can't find a command that works but I am a beginner, so I'm hoping someone's got a solution?!

    Hi again!
    Thank you for your help but I've just discovered that my problem probably doesn't have to do with the way that I call for the batch file. It's more like this:
    The batch file is run but it only does its job some of the times... The batch contains one name of a converter application (Convert.exe) and the names of some databases and files. I've been told that the conversion should work if Convert.exe is located in the same folder as the files. Which it also does, if I run the batch from "Run..." but not from my code.
    I had it working for a while when I had fiddled (as I said, I'm a beginner at this) with setting some drives, such as userDrv and changing some paths in the script settings. Since I didn't really know what I was doing though, I didn't save these settings when closing down DIAdem and now it's not working again. When it worked, it only worked for the file where my .VBS was saved. The point of the program is to convert files in different folders so that wasn't enough.
    Just for clearity: I can't write the name as "C:\My Folder..." because the batch file name and the folder it is situated in is different each time so I have variables for the path and the batch, but that part seems to work. (Call ExtProgram(batFilename_) where batFilename_ includes the path).  
    So I guess what I need to understand is how the different drives work or maybe I need to somehow change my path settings?

  • Report Execution from within Java application

    I am currently running my Oracle reports through a Java application where I just create a HttpURLConnection to the reports server and push in my report request, and then read the connection input stream in order to obtain the generated report. This is working without too many problems except that in some cases where the report is generated but the application does not seem to understand the reponse.
    I see that there is in fact a Java API available for the reports. Is it possible to integrate this into my application in the same/similar way as I am doing now? If so, where can I get the associated docs as the supplied Javadocs are not too explicit.
    Thanks
    Justin

    You'll have to write a custom ClassLoader to do this - modifying the existing ClassPath from within the JVM just isn't possible.

  • Manipulate Indesign cliente from a Java Application

    Hello, I need to manipulate Indesign client(open/close documents, create menus, tables, set colors etc... ) but I need to do that from a Java application. Is it possible? I was searching on google about it, even in Adobe's site, but the only way I found was thought Javascript, VbScript or AppleScript.
    Thanks in advance!
    Rafael

    I can control inDesign from Python or shell scripts on osx via `osascript` This is roughly how it works.
    My 'master' program runs shell command `osascript -e "tell Indesign blahblah end tell" /path/to/temporary.jsx`  
    `osascript` tells Indesign to execute "/path/to/temporary.jsx" as javascript
    If all goes well, the value of last expression  in .jsx is returned by `osascript` (serialised JSON works great for this)
    Sorry I'm vague on real life code, but this is my home machine so it's not in my reach.
    I realise it's an ugly hack. Main cons follow:
    quotes have to be escaped couple of times so the result is messy and prone to errors (luckily it's one-off code that sits hidden behind main interface)
    debugging this chain is nightmare (especially with my nigh-zero knowledge of applescript)
    so far it's mac only (I suspect same thing can be achieved on Windows machine with VBS)
    one cannot avoid writing lots of temporary files to the system. (luckily for me, it's only deployed on machines under my control, so the temp files are written to /tmp which is mounted on ramdisk)
    The only pro I can think of is that it works. Whole comlexicity is wrapped in one python module, which I only see when squashing the bugs.
    Marcel

Maybe you are looking for