Hot to call forms11g fmx file through Java executable
Hi,
Iam having one file in some folder which will come through FTP , whenever file comes to the folder i should call the some form fmx file through JAVA so that my form will take care rest of the things .
My question is how to call fmx through Java executable in windows environment.
thanks in advance
GV
Hi All,
Thnaks for the Info. But my requirement is different.
1) whenever i received a file through FTP from other server to my server , some folder say d:\Test
a) some batch program has to trigger and first it should take the backup of the received file to some other folder say d:\archive
b) some batch program has to trigger to call the forms fmx file so that form will take care of reading from the file and put the data to database for the received file in d:\Test.
Assume that it is in windows environment/Linux Environment . How i can achieve these tasks. There should not any user intervention in this , everything is automatic.
Please guide me any solutions
Thanks in advance
GV
Similar Messages
-
How to call a .bat file from java code?
How to call a .bat file from java code? and how can i pass parameters to that .bat file?
Thanks in advancethanks for ur reply
but still i am getting the same error.
I am trying to run a .bat file of together tool, my code looks like below
import java.lang.Runtime;
import java.lang.Process;
import java.io.File;
class SysCall{
public static void main(String args[]){
String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
//String path="D://Borland//Together6.2//bin//Together.bat ";
Runtime r= Runtime.getRuntime(); //Declare the system call
try{
System.out.println("Before batch is called");
Process p=r.exec(cmd);
System.out.println(" Exit value =" + p.exitValue());
System.out.println("After batch is called");
/*can produce errors which must be caught*/
catch(Exception e) {
e.printStackTrace();
System.out.println (e.toString());
I am getting the below exception
Before batch is called
java.lang.IllegalThreadStateException: process has not exited
at java.lang.Win32Process.exitValue(Native Method)
at SysCall.main(SysCall.java:17)
java.lang.IllegalThreadStateException: process has not exited -
Error while running executable file through java in WinNT
I would like to run an executable file with Java.
- If I try with notepad or paint, i.e. Windows Applications,
I have no problem.
- I also can run Non-Windows-Own Applications, except one.
I get an error message, if I want to run this program through Java.
I have tried following commands to run an executable file.
Runtime.getRuntime().exec("cmd.exe /c "+command);
Runtime.getRuntime().exec("cmd.exe /c start "+command);
Runtime.getRuntime().exec("cmd.exe /c start /wait "+command);
Runtime.getRuntime().exec("cmd.exe /k start "+command);
command : the path to the executable file
I can run the application directly, if I click the icon on desktop,
but not through Java.
here is the error message I get
screenshot : http://www.aykut.de/error_message.jpg
Text : "Security Check failure"
The Logon System has been tampered with.
The Administrator will need to re-install.
my Idea :
The application is "old".
I think it was written for Win 3.1.
Therefore I don't know if there is any other
possibilty to run a "DOS Exe File" through Java.I have just figured out how it works,
if somebody else here in forum have this problem,
here is the solution :
String path = "F:\...\...\Application.exe";
String envDir = path.substring(0, path.lastIndexOf("\\"));
String[] command = {"cmd.exe", "/c", "start", "/wait", "/D"+envDir, path};
Process process = Runtime.getRuntime().exec(command);
"start /Dpath" => path: environment directory F:\...\...\
"start /wait" => wait until Application.exe terminates
if you use Win95 or Win98 use command.com instead of cmd.exe
Aykut -
How to get the source code of an HTML page in Text file Through java?
How to get the source code of an HTML page in Text file Through java?
I am coding an application.one module of that application is given below:
The first part of the application is to connect our application to the existing HTML form.
This module would make a connection with the HTML page. The HTML page contains the coding for the Form with various elements. The form may be a simple form with one or two fields or a complex one like the form for registering for a new Bank Account or new email account.
The module will first connect through the HTML page and will fetch the HTML code into a Text File so that the code can be further processed.
Could any body provide coding hint for thatYou're welcome. How about awarding them duke stars?
edit: cheers! -
Problem with opening the .fmx file through hyperlink
I am trying to open a .fmx file through hyperlink. After clicking on the hyperlink a dilogue box opens up and asks for "open from the remote server", "save on the local disk" and cancel. If I click on open the .fmx file opens up and applications starts working.
Problem is "I do not want this dialogue box to be opened after clicking on the hyperlink". I tried to change the mime type and changed the setting of Internet explorer. But it does not work.
Any suggestion will be appreciated.
thanx in advance
anil dhimanwhever i refresh the entire application in the tomact then its been recognizedMaybe you're creating and downloading it asynchronously so that the creation of the file isn't finished yet while you're about to download it.
-
Problems with calling a Bat file in java...
i'm having some issues when i try to call my bat file within java...
here is the code
Runtime.getRuntime().exec("cmd.exe C:\\dev\\CMIC\\components\\client\\bin\\startup.bat");
it starts up the bat file but it seems to only execute the first line in the bat, then it shuts it down... i dont get it. cuz if i call that bat from another bat it works fine.. if i click on it, it works fine why would java have a problem with it?After doing some searching around... this is what i came up with.. but i still get the same results.. the dos screen pops up and then poof.. its gone..
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
public class test {
public static void main(String Args[]){
System.out.println("About to try and EXecute the Bat");
//String retVal = ExecWindows( "cmd.exe C:\\dev\\CMIC\\components\\client\\bin\\startup.bat" );
String retVal = ExecWindows( "cmd.exe /C C:\\dev\\CMIC\\components\\client\\bin\\startup.bat" );
System.out.println(retVal);
private static String ExecWindows(String cmd) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream(100 * 1024);
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(cmd);
StreamGobbler errorGobbler =
new StreamGobbler(proc.getErrorStream(), "ERROR");
StreamGobbler outputGobbler =
new StreamGobbler(proc.getInputStream(), "OUTPUT", bos);
errorGobbler.start();
outputGobbler.start();
int exitVal = proc.waitFor();
//if ( DEBUG ) System.out.println( "cmd: '" + cmd + "' -> " + exitVal );
errorGobbler.join();
outputGobbler.join();
//if (DEBUG && exitVal != 0)
// System.out.println(" ExitValue: " + exitVal);
if (exitVal != 0)
return "";
bos.flush();
String output = bos.toString();
bos.close();
return output;
} catch (Throwable t) {
return "";
} /* * Handle standard I/O streams */
} // end of class
class StreamGobbler extends Thread {
InputStream is;
String type;
OutputStream os;
StreamGobbler(InputStream is, String type) {
this(is, type, null);
StreamGobbler(InputStream is, String type, OutputStream redirect) {
this.is = is;
this.type = type;
this.os = redirect;
public void run() {
try {
PrintWriter pw = null;
if (os != null)
pw = new PrintWriter(os);
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line = null;
while ((line = br.readLine()) != null) {
//System.out.println( "{" + line + "}" );
if (pw != null) {
pw.println(line);
} else {
System.out.println(type + ">" + line);
if (pw != null)
pw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} -
How can i call forpro prg file from java
Hai friends,
I have a doubt,clear it.
how can i call forpro prg file from java file
by,
N.VijayThanks to your reply,
I have some print statements in my foxpro program file.
Then i like to invoke that foxpro file from my java file
This want i want..,
by,
N.Vijay -
I need to call a batch file from java and pass arguments to that Batch file
Hi,
I need to call a batch file from java and pass arguments to that Batch file.
For example say: The batch file(test.bat) contains this command: mkdir
I need to pass the name of the directory to the batch file as an argument from My Java program.
Runtime.getRuntime().exec("cmd /c start test.bat");
How to pass argument to the .bat file from Java now ?
regards,
Krish
Edited by: Krish4Java on Oct 17, 2007 2:47 PMHi Turing,
I am able to pass the argument directly but unable to pass as a String.
For example:
Runtime.getRuntime().exec("cmd /c start test.bat sample ");
When I pass it as a value sample, I am able to receive this value sample in the batch file. Do you know how to pass a String ?
String s1="sample";
Runtime.getRuntime().exec("cmd /c start test.bat s1 ");
s1 gets passed here instead of value sample to the batch file.
Pls let me know if you have a solution.
Thanks,
Krish -
How can i call a c++ function through java
Hi,
dose anyone knows how to call a C++ function in java?
Thanks.see JNI...
basically declare a native method in your java class, then run javah on the class thus generating a *.h file. Then implement the c/c++ function. Compile the c/c++ part as a shared library, and make sure its accessible from your LD_LIBRARY_PATH env variable.
Go through the steps in the JNI docs, and things shoulde be fine... hopefully ;) -
Crystal report - generate CSV file through Java interface
Hi,
I need to generate a Character Seperated File through Crystal Report 10 using Java.
What constant stands for CSV Format and what value of SI_PROGID we can provide to pull the CSV format.
Eg. SI_PROGID = ceProgID.EXCEL or SI_PROGID = ceProgID.PDF .....
Currentlly we are crystalLibs.jar to connect the Crystal server.
Thanks In AdvanceIn BusinessObjects Enterprise installations, the following ProgIDs are valid.
CrystalEnterprise.Analytic
CrystalEnterprise.AppFoundation
CrystalEnterprise.Calendar
CrystalEnterprise.Category
CrystalEnterprise.Connection
CrystalEnterprise.Designer
CrystalEnterprise.Destination
CrystalEnterprise.DiskUnmanaged
CrystalEnterprise.Event
CrystalEnterprise.Excel
CrystalEnterprise.Folder
CrystalEnterprise.FavoritesFolder
CrystalEnterprise.Ftp
CrystalEnterprise.Hyperlink
CrystalEnterprise.Inbox
CrystalEnterprise.InfoView
CrystalEnterprise.LicenseKey
CrystalEnterprise.Managed
CrystalEnterprise.MyInfoView
CrystalEnterprise.ObjectPackage
CrystalEnterprise.Overload
CrystalEnterprise.Pdf
CrystalEnterprise.PersonalCategory
CrystalEnterprise.Powerpoint
CrystalEnterprise.Program
CrystalEnterprise.Report
CrystalEnterprise.Rtf
secEnterprise
secLDAP
CrystalEnterprise.Server
CrystalEnterprise.ServerGroup
CrystalEnterprise.Shortcut
CrystalEnterprise.Smtp
CrystalEnterprise.Txt
CrystalEnterprise.Universe
CrystalEnterprise.User
CrystalEnterprise.UserGroup
CrystalEnterprise.Webi
CrystalEnterprise.Word -
How to call the DLL functions through Java
Hello,
I have already got a VC++ generated DLL. It has serveral functionalities. I need to call those functions from my Java Application. Now i know that it can be possible only through writing Java JNI Interfaces.
Everywhere i only see they give an example where in they tell to create an DLL. Now how do i will call if an DLL is ready and exists.
If anyone can give an example then it will be very helpful to me. Please mail me at [email protected] .
Thank you
vvpatroYou can't call functions in an arbitary DLL form Java. You need to use JNI to produce a 'wrapper' DLL that maps Java methods to the methods in the target DLL. The purpose of the wrapper is to allow type conversion between Java types and C/C++ types. The complexity of this task depends largely on the types used in th target DLL. If the targer DLL uses only primitive types such as char, byte, int, long, string, the translation is simple and the wrapper DLL will be 'thin'. If however, the target DLL passes arrays and objects, or employs callbacks, these more work to do, and the wrapper will be correspondingly 'thicker'.
Hope this helps. -
How to call the javascript file through sdk?
I created a plugin through SDK. Now i need to call my javascript file in that plugin code(c++). Could you please advice me with some samples. This is for "Illustrator CS".
Thanks,
PrabudassI haven't the foggiest idea, except to perhaps suggest firing a script by using the AIActionManager::PlayAction command. That's assuming you can 'action' the use of a script though. If you can, it should be possible that way, if not, I have no idea.
-
How to compile dunamically genrated java files through java program?
Hi, I have a requirement where i generate java files from WSDL dynamically using wsdl2java jaxbri. I need to compile these files dynamically on the fly and jar it. Everything should happen through java program. Bcos everything is dynamic here, no information is known (like dir, file names ...) until the runtime. Everything is user fed.
the directories may contain other directories with java files. its recursive
i tried com.sun.tools.javac.Main.. but either its not scaling to my needs or i donno how to wok with this.
is there any option to compile the java files as they are created thru JAXBRI (wsdl2java)?
any help is appreciated..
-smy requirement is :
i create java files from wsdl2java (axis).. i need to compile all the java files.. directories with in the directories (recursive)...
as bcos the the java files have inter-dependencies they have to be compiled as a bunch something like (java *.java). I donno how to do this in javac.Main tool
Once all these files are compiled i need to create a jar out of them
Any help is appreciated! -
.sql file through Java and procedures
I want to execute .sql file (on my local system) to run on a oracle database.
Also please tell me how can I run multiple procedure simultenously through Java class.
Thanks in AnticipationFirst you need a multi-CPU machine or you're never going to execute more than one statement at once.
Next you need to know how to create a multithreaded program.
After that, you need to figure out how to read that file and separate the statements in it so each can be fed to one of those threads. -
Invoking batch file through java pgm
hi
i want to invoke run.bat file from java pgm, i have written following code
String[] cmd = new String[4];
cmd[0] = "cmd.exe";
cmd[1] = "/C";
cmd[2] = "start";
cmd[3] = "run.bat";
Process p=Runtime.getRuntime().exec(cmd);
p.waitFor();
It's working without error but it is not giving any output.
plz guide
Also give me syntax to run commands of cmd through java pgm.
ThanksHi,
What type of output you expected. If you want to cmd output from process then use following code
String[] cmd = new String[4];
cmd[0] = "cmd.exe";
cmd[1] = "/C";
cmd[2] = "start";
cmd[3] = "run.bat";
Process p=Runtime.getRuntime().exec(cmd);
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
pingResult += inputLine;
in.close();
p.waitFor();Edited by: sagar_birari on Mar 26, 2008 4:47 AM
Maybe you are looking for
-
I am having trouble scanning a legal size document from my Canon printer onto my MacBookPro. I have set the printer paper size option to legal size on my printer. The scanned document comes through as a letter size document after scanning. I do not s
-
Interconnect scanner with java'aplicationa
I have to do an aplication'java and this has to comunicate with a scanner, the scanner'drivers is implement in C. I mean use JNI for the comunication between drivers and the aplication'java but I need that the methods'drivers be implement how native.
-
View documents side by side (tile)
Before I upgrade to Acrobat X Standard. In Acrobat 9 Standard you can go to Tools - Tile- Vertical or Horizontal This whay you can compare or modify by dragging pages of 2 or more documents. Can you do this in Acrobat X Standard?
-
Indesign CS5.5 hangs on startup
Hi, My Indesign CS5.5 (I'm running Macosx 10.6.7) hangs on startup and gets this crash log: http://pastebin.com/xDXmdrt4 I've tried removing the recovery folder, the settings prefs and the FontExplorer plugin... nothing helps. Anyone? /Erlandsen
-
Report, tcode, list or anything that contained a price unit
HI, Is there any report, tcode, list or anything that contained a price unit (price unit in sales order) beside VA01, VA02 & VA03 (standard SAP) ? Thanks & Best Regards, Saiful arif