Unable to run UNIX command after uploading file using webutil_file_transfer
OS: UNIX Solaries , Oracle Application Server 10g
I designed a form contains 2 buttons
1- <b>Upload</b> button: to let the user upload form.fmb file to the application server using webutil_file_transfer function
2- <b>Compile</b> button to compile the uploaded form in the applications server to generete the FMX using the following command
host('/bin/bash /u01/oracle/runtime/test/frmkfccmp.sh >/u01/oracle/runtime/test/log.log'); The problem is after uploading the file to the server, the Compile button don't work, although it works well if I close the form then open it again and press the Compile button without pressing the <b>Upload</b> button
Any help is appreciated
Thanks and Regards
Add the weblogic server's bin directory to your PATH. You will need to a couple of WLS jars to the CLASSPATH. There might be something in the installation/setup documentation that tells you all this. I have only used WLS 5.1 and 7.0.
Similar Messages
-
Error in uploading file using webutil_file_transfer
Hi,
I am using webutil for a forms module which would upload the required file into the database using webutil_file_transfer.client_to_db_with_progress.
I have made the necessary changes to the files webutil.cfg and formsweb.cfg as per the instructions in the webutil documentation.
The error is that the file I am trying to upload doesnt get uploaded.
Following is the code snippet.
DECLARE
l_success BOOLEAN;
BEGIN
l_success :=
webutil_file_transfer.client_to_db_with_progress
(clientfile => :upload.filename,
tablename => 'TBL_UPLOAD',
columnname => 'FILEDATA',
whereclause => 'ID = 1',
progresstitle => 'Upload to Database in progress',
progresssubtitle => 'Please wait...',
asynchronous => FALSE,
callbacktrigger => NULL
commit;
IF l_success
THEN
MESSAGE ('File uploaded successfully into the Database');
ELSE
MESSAGE ('File upload to Database failed' );
END IF;
EXCEPTION
WHEN OTHERS
THEN
MESSAGE ('File upload failed: ' || SQLERRM);
END;I keep getting the message File Upload to Database Failed. The parameter transfer.database.enabled in the file webutil.cfg has also been enabled to TRUE.
I am using Forms 10g, deployed on Red Hat Linux AS 4. The Database is Oracle 10G Release 2.
Any suggestions, clues?
Thanks,
Rishikesh.I have finally got it working.
I copied the version of webutil.pll file from the developer suite onto the server.
This has got it working and the file(s) I am uploading are going through correctly.
I still have one query though. The progress bar which displays the upload progress seems to be in the top left corner of the screen, any parameters we can set so as to get it in the middle of the screen?
Thanks,
Rishikesh -
Running Unix Command from WEB-APPLICATION
Hi all,
I want to run unix command from a java-based web application. the basic code part is this ---
public class RunCommand
public String runIt()
String s = null, returnString = "";
Process p=null;
try
Runtime rt = Runtime.getRuntime();
p = rt.exec("sh testPOC.ksh");
p.waitFor();
BufferedReader stdInput = new BufferedReader(new
InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new
InputStreamReader(p.getErrorStream()));
// read the output from the command
returnString += "Here is the standard output of the command:<br>";
while ((s = stdInput.readLine()) != null) {
returnString += s;
// read any errors from the attempted command
returnString += "Here is the standard error of the command (if any): <br>";
while ((s = stdError.readLine()) != null) {
returnString += s;
catch (IOException e)
returnString += "exception happened - here's what I know: ";
returnString += "error-> " + e.getMessage();
catch(Exception e)
returnString += "exception happened - here's what I know: ";
returnString += "error-> " + e.getMessage();
return returnString;
}this class is kept as an inner class. The control comes to its outer class, from servlet, from which the runit() is called. but the exception is occuring at line of p=rt.exec(.....). it tells "<command name> : not found transaction completed" [got this using getMessage() method].
i am unable to show(and see, too) the stacktrace, because i don't have access to that test environment and its log. i can't run this in local because its windows one.
now can anyone tell me, where is the problem. is there any limitation in web application server/container? this was successful when i used command prompt writing a .java file. Please help me. Thanks in advance...Friends, i've got, where the problem is.
when we run a class file directly from a command prompt, we get an environment with that shell window. but for a servlet application running these kind of commands from a class creates kind of child processes. each and every command is executed as a child process of jvm and don't get those environment. we have 'PATH' variable in the environment. when a command (say, 'dir' or 'sh' or 'ls', etc.) is executed, the shell first search for that executable file (i.e. dir / sh / ls) in the given paths in the variable 'PATH'. this is not available for the child commands of jvm. hence the basic commands are searched in the current directory of the jvm and they are failed.
i solved the problem giving full path of the commands. like :
p = rt.exec("/bin/sh runningScript.ksh") -
Unable to excute unix command from java program
import java.io.File; // is java code
public class RunSystemCommand {
public static void main(String args[]) {
String s = null;
// system command to run
String cmd = "ls ";
// set the working directory for the OS command processor
File workDir = new File("c:/cygwin/cygwin");
Process p = Runtime.getRuntime().exec(cmd, null, workDir);
p.waitFor();
I am tryiing to excute above code to run unix command on cygwin but gave folllowing error...... but works well to open a note pad..
Exception in thread "main" java.io.IOException: CreateProcess: C:/cygwin/bin err
or=5
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at d.main(d.java:19)
It seems using this functionone cannot excute unix commands..please help to do so..Are you sure you want cygwin/cygwin?
the following works fine for me, you may need change the workDir to your bin folder
import java.io.File; // is java code
import java.io.InputStream;
public class RunSystemCommand {
public static void main(String args[]) throws Throwable {
String s = null;
// system command to run
String cmd = "ls ";
// set the working directory for the OS command processor
File workDir = new File("c:/cygwin/bin");
Process p = Runtime.getRuntime().exec(cmd, null, workDir);
InputStream pis = p.getInputStream();
while( pis.read() != -1 ); // added, as otherwise the ls hangs.
p.waitFor();
} -
How to run unix command from Oracle Foms 10g
OS: UNIX Solaries, Oracle Application Server 10g
To run shell script from Oracle Forms, I used the following host('/bin/bash /u01/compile.sh') and it works well
Now, I need to run unix command something like
host('mv form1.fmx FORM1.FMX') but it's not working
I tried to append the command "mv form1.fmx FORM1.FMX" to the compile.sh shell script but also it's not working although the rest lines of the shell script is running well
Edited by: slamonty on Aug 23, 2012 12:36 AMYes, Thank you so much, it works well as follow
$ /bin/mv /u01/oracle/runtime/test/form1.fmx /u01/oracle/runtime/test/FORM1.FMX Edited by: slamonty on Aug 23, 2012 9:59 AM
Edited by: slamonty on Aug 23, 2012 11:14 AM -
Run Unix command / Run Unix shell script from Forms9i
Hi,
I have a requirement to run Unix command and Unix shell scripts from Forms9i.
I know HOST command cannot be used directly. I also know we can create some JAVA stored procedure to perform the task, but I don't want to create any JAVA stored procedure as there are some security concerns.
Please point me towards any other way to achieve the same.
I would really appreciate your help.
Thanks,
KumarThere is no reason why HOST can't be used. This is what it is for. As for using Java, it is not a stored procedure that you would be using, it would be imported Java (imported into the form).
The best way to use the HOST command is to call a script (.sh) rather than calling a Unix command directly. This is because HOST will not pick up environment variables set at the system level. So the script would first need to set the necessary environment variables then call the desired commands. -
Running unix commands from within a procedure
Oracle 11.1, AIX 6.1
================
A developer would like to know what the commands are to execute from within a procedure to run unix commands on the database server and capture those results back to the procedure for parsing & manipulation.
Thanks.Don't take this as the correct way to do it, but this is merely 'a' way to do it:
have a db procedure thats executes a db function
create or replace procedure csproc(p_cmd in varchar2)
as
x number;
begin
x:=csfunc(p_cmd);
dbms_output.put_line('x is: '||x);
end;
/The function calls a piece of java to execute the os command and return the return code of the os command
create or replace function csfunc( p_cmd in varchar2) return number
as language java
name 'csclass.RunThis(java.lang.String[]) return integer';
/Here is the java class to run the os command
create or replace and compile java source
named "csclass"
as
import java.io.*;
import java.lang.*;
public class csclass extends Object
public static int RunThis(String[] args)
Runtime rt = Runtime.getRuntime();
int rc = -1;
try
Process p = rt.exec(args[0]);
int bufSize = 4096;
BufferedInputStream bis =
new BufferedInputStream(p.getInputStream(), bufSize);
int len;
byte buffer[] = new byte[bufSize];
// Echo back what the program spit out
while ((len = bis.read(buffer, 0, bufSize)) != -1)
System.out.write(buffer, 0, len);
rc = p.waitFor();
catch (Exception e)
e.printStackTrace();
rc = -1;
finally
return rc;
/and finally the os command - in this case its a very simple shell script
#!/usr/bin/ksh
echo "Hi" >> /app/oracle/workdir/cs.logwill have to grant privileges to my user 'CS' to run the various os commands
exec dbms_java.grant_permission('CS','java.io.FilePermission','/app/oracle/workdir/cs.ksh','read,execute');
exec dbms_java.grant_permission('CS','java.io.FilePermission','/app/oracle/workdir/cs.log','write');
exec dbms_java.grant_permission('CS','SYS:java.lang.RuntimePermission','*','readFileDescriptor');
exec dbms_java.grant_permission('CS','SYS:java.lang.RuntimePermission','*','writeFileDescriptor');and finally can run the procedure from within the db
set serveroutput on
exec dbms_java.set_output(1000000);
exec csproc('/app/oracle/workdir/cs.ksh');
x is: 0
PL/SQL procedure successfully completed.to prove it works ok the logfile shows an entry:
'Hi' -
I am attempting to upload files using the zend _file_transfer system from cs5 training from the source.
On trying to upload to a remote server I am having trouble with the destination setting (C:/upload_test) in the example, please could you point me in the right direction for the an example of this setting for a remote file transfer
Also do I have to construct a connection file to activate a Ftp file transfer?
David Woolston>I am on windows platform
Who is your host? When you checked your host path in your host control panel, what did it say?
>i have assumed (may be incorrectly) that the purpose of the exercise was to upload to a remote site (ie my website)
That is correct.
>Of course that upload might take place on a computer that does not have DW installed (an internet cafe for example)
That's irrelevant. DW is just the tool you are using to build your site. The site runs on your hosting accounts servers. This includes the php scripts you are working with.
>I have uploaded all files necessary for the operation, when i click upload it returns no such directory exits.
Do you have a url we can check? What destination are you specifying in zend code?
>This made me suspect that I would need to construct a ftp file transfer connection file to satisfied username, password , connection address etc
The exercise you are dealing with is using http file transfer. This has nothing to do with FTP. You do not need FTP for this, other than using it to move your source code from your local client to your server. -
How to upload file using *cl_gui_frontend_services* method
hi
i want to upload an image file using this method
and i want to save it in MIME Repository (/SAP/BC/BSP/SAP/PRASHANT)
DATA:
itab TYPE TABLE OF sflight.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = 'C:\temp\winter.jpg'
filetype = 'ASC'
has_field_separator = '|'
CHANGING
data_tab = itab
IF sy-subrc = 0.
WRITE:/ 'success'.
ENDIF.
So plz tel me how i set given path to upload file using this method .Hi Prashant,
Go through the [Link|https://forums.sdn.sap.com/click.jspa?searchID=24477690&messageID=6684222].
Hope this is helpful.
Regards,
Abhinav -
I have a field of File Type in my Entity. How can I upload file using WCF API?
I tried to create a new Entity Member and added the following attribute in the member attributes collection
Attribute att = new Attribute();
att.Identifier = new Identifier();
att.Identifier.Name = "Image";
att.Value = bytes;
In attribute value I tried to pass the bytes array of an image, also tried Encoding.ASCII.GetString(bytes); as attribute value, but none of them works.
With byte array i get the following exception "Conversion failed when converting the nvarchar value 'System.Byte[]' to data type int." and in case of ASCII string i get "A database error has occurred. Contact your system administrator." error.
There is lack of documentation and samples.
Please let me know if someone tried it out.
Thanks!You need to use the EntityMemberAttributesGet operation to retrieve the contents of a file attribute. EntityMembersGet is designed to retrieve a collection of many members and therefore it would not make sense to retrieve every file for every row retrieved.
In contrast, EntityMemberAttributesGet is designed to work with a single member and specific attributes of that member, and it was designed to retrieve the file content.
Val Lovicz
http://www.profisee.com
[email protected]
As the original creators of Microsoft MDS, Profisee's Master Data Maestro provides a range of enterprise-grade functionality to ensure MDS project success. -
Maximum size of upload file using Cross Domain Library
Hi All
I need to know what is the maximum size of file that I can upload using Cross Domain Library from my Provider hosted app. I know that in msdn it is written that usign REST call we can upload upto 2GB but I have doubts if it is true with Cross domain library
REST Calls. Please suggest.
spExecutor.executeAsync(
url: fileCollectionEndpoint,
method: "POST",
contentType: "application/json;odata=verbose",
body: filedata,
binaryStringRequestBody: true,
headers: { "X-RequestDigest": $("#__REQUESTDIGEST").val(), "accept": "application/json;odata=verbose" ........
And Can I pass ArrayBuffer directly or I need to pass only binary string ?
Thanks in AdvanceHi,
According to your post, my understanding is that you want to know the Maximum size of upload file using Cross Domain Library.
Per my knowledge, you can upload files up to 2 GB with the REST API.
You can refer to:
How to: Upload a file by using the REST API and jQuery
In addition, you can pass ArrayBuffer directly. Please refer to:
FileCollection methods
Thanks,
Linda Li
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Linda Li
TechNet Community Support -
how is posible upload files using a browser (IE5) to BD ?
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JuanCarlos HorrachCampins (jchorrach@globalia:
how is posible upload files using a browser (IE5) to BD ?<HR></BLOCKQUOTE>
The Form enctype=multipart/formdata and input type=file parameters are needed along with method=post.
You then need a servlet(or MS PostingAcceptor) on the server side to read/store it. The Post data is in multiple parts with the parms on separate lines..
Here is sample HTML Form:
<HTML>
<BODY>
<H2>Uplaod test </H2>
<form enctype="multipart/form-data" action="/examples/servlet/MultipartForm"
METHOD="POST"
NAME="UploadFileForm"
LANGUAGE="JavaScript"
onSubmit="if (!validateForm(document.UploadFileForm))
alert ('Please enter a fileName.');
document.UploadFileForm.my_file.select();
return false;
}">
<input type="text" name="TargetURL" value="/uploads">
<input type="text" name="submitter" value="me">
<FIELDSET> <legend> FileUpload</legend>
<BR>
<table>
<tr>
<td align="left">Fully qualified Filename to upload:</td>
</tr>
<tr>
<td align="left"><input name="file" type="file" size="50"></td>
</tr>
<tr>
<td align="left"><input type="Submit" value="Upload File"></td>
</tr>
<table>
</FIELDSET>
</form>
<SCRIPT LANGUAGE="JavaScript">
// Begin client side helper functions
function validateForm(form)
if (isEmpty(form.file)) return false;
return true;
function isEmpty(textcontrol)
str = textcontrol.value
for (i = 0; i < str.length; i++)
chr = str.substring(i, i + 1);
if (chr != ' ')
return false;
return true;
</SCRIPT>
</BODY>
</HEAD>
null -
Uploading Files Using InputFile Component -- Sometimes not working
Hello,
This is the 2nd time I make a post about it!
Because I have more than 1 application using upload, and everything is correct! But it doesn't work as it should!
You can check the original post here: Uploading Files Using InputFile Component - Sometimes not working
I need a solution please!
The only thing we can conclude is that it could be a bug from oracle !!! (???) But I talked with other people and they say that it works fine for them.
There is one important thing: when we put a form to "Uses Upload = true" it seems that the page doesn't work very normal. For exemple: if you use a table in a form that uses upload the table get's "crazy".
Thanks,
JPI have now access to METALINK!
I can find some problems and patches about inputFile but not mine! I will check better later!
I think the problem is caused because of my framework! -
Unable to run Java Command (on UNIX)
Hi,
When I try to run Java command:
java ChatServer 9830
I get the following error:
/usr/bin/java: line 67: /tmp/javaJb9694: Permission denied
/usr/bin/java: line 67: /tmp/javaJb9694: Success
Could any one suggest what could be the reason and solution.
The site is hosted on a UNIX palatform and we are using Tomcat.
Thanks & Regards,
Joy.lol
How would we know? We don't know your setup, we don't know your software, we don't know what happens...
It doesn't even look like a standard Java message to me. -
Running unix command using java shows error
Hi All,
I am trying to run UNIX move command using Java exec method but its throwing error, unable to rename. Here below is the code i am trying to run to move all files from one directory to another directory. source and destination directory exists.
public class Demo
public static void main(String args[])
try
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("mv /home/demo1/* /home/demo2");
int exitVal = proc.waitFor();
System.out.println("Process exitValue: " + exitVal);
} catch (Throwable t)
t.printStackTrace();
}if i give "mv /home/demo1 /home/demo2" in exec method, its working, with * character its giving problem.
Please help me in resolving the problem.
Thank youCharacters like *, >, &, |, etc. are interpreted by the command shell--that is by the bash, zsh, etc. programs. When you execute a command with ProcessBuilder or Runtime.exec, you're not going through one of those shells, so their interpretation of those characters is not available.
In your code, the character * is being delivered directly to the mv command (which doesn't think * is anything special), as opposed to being turned into a list of files and directories as it would be when it's interpreted by the shell. The mv command doesn't know anything about the * character being special.
If you want to have those shell interpretations, you need to execute the command through a shell. One example is like so, but a) you'll want to read up on the methods in exec() that take arrays of String, and b) you'll want to read up on ProcessBuilder, and c) you'll need to check your shell's man pages to see the exact syntax and arguments.
runtime.exec("/bin/bash -c 'mv x/* y'");
Maybe you are looking for
-
How can I get a search bar added to my email archives screen to make it easier to search for the right archives folder, Samsung has one so I was surprised to see that I have to scroll up and down to find the right folder?
-
[SOLVED] Xmobar doesn't switch fullscreen windows to tiling
I'm using slightly modified config file i got from here: -- xmonad config used by Vic Fryzel -- Author: Vic Fryzel -- http://github.com/vicfryzel/xmonad-config import System.IO import System.Exit import XMonad import XMonad.Hooks.DynamicLog import XM
-
How can I make triple partition for OSX, Windows 8, and for saving Data
I read many articles on googles yet I still can't figure out how to. The point that I get is when you're installing Windows using bootcamp, before it actually try to install windows, i have to go back to OSX, choose disk utility and create the 3rd pa
-
Final cut express to final cut pro x ?
Is it possible to move my films from Final Cut Express to Final Cut Pro X ?
-
5800 after update (V51.0.006) no Bluetooth
After installing the last Version(V51) on my Nokia 5800, I cant enable the bluetooth! After input the code *#2820# the bluetooth MAC adress is empty! Following I have tested, but nothing works: - hard-reset - soft-reset - remove accu for a long time