Solved

how does jsp run linux command (tomcat+oracle exp)?

Posted on 2004-04-13
5
758 Views
Last Modified: 2010-04-01
how does jsp run linux command (tomcat+oracle exp)?

if i run
/opt/oracle/product/9.2.0/bin/exp USERID=user/passwd FILE=/tmp/FAKES-2004-4-13-2140.dump

in linux console

i am get a file /tmp/FAKES-2004-4-13-2140.dump with size = 35274752bytes

but if i run following jsp code

<%
    Runtime rt = Runtime.getRuntime();
    String command = "/opt/oracle/product/9.2.0/bin/exp
    /opt/oracle/product/9.2.0/bin/exp USERID=user/passwd FILE=/tmp/FAKES-2004-4-13-2140.dump

    Process proc = rt.exec(command);
    proc.waitFor();
    out.println("Hello");
%>

it just generate a file with size = 57344 bytes in /tmp
all then stops
even "Hello" cannot be shown

57344/1024 is equal to 56k exactly

is tomcat 5.16 limit the file output size to 56K?

if not, how can i solve this problem?

thank you......^.^
0
Comment
Question by:kelvinlaw
5 Comments
 

Author Comment

by:kelvinlaw
ID: 10813647
String command = "/opt/oracle/product/9.2.0/bin/exp USERID=user/passwd FILE=/tmp/FAKES-2004-4-13-2140.dump"


0
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 10817971
Looks like the process is not completing.
does the process send any data to stdout or stderr? If so the buffer could be filling up and blocking the process.

Here's an example that handles reading stdout and stderr or the process that may help you:

http://www.objects.com.au/java/examples/util/ConsoleExec.do
0
 
LVL 1

Assisted Solution

by:KartikShah
KartikShah earned 250 total points
ID: 10919231
From the command that you are trying to execute, it looks like you are trying to run Oracle's export. If my understanding is wrong, please igonre the comment ... :)

If I rember correctly, if you use the command as it is on the command prompt, the oracle export starts a interactive session.

Your command seems to be incomplete, as the command does not contains the information of the schemas, tables, procedures, etc .. that need to be exported.

I have the export command for oracle 8 export for windows,

./bin/exp system/oracle file=export_file.dmp log=export_file.log full=Y consistent=Y buffer=10000000

You can modify the command for linux.

Try to use the command on the prompt irst, to comfirm, that there is no user interaction and the process executes successfully on the prompt, and then try it via Java ... hope it helps ... :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
form submissions on a web page 2 143
JSP call a method on a session attribute which is an object 2 61
Session migration 1 102
how to hide hide popup page refresh second time? 10 109
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now