Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2004-04-13
5
760 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This article describes how to reset your Windows 10 password when you've forgotten it.
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1

828 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