Solved

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
In  today’s increasingly digital world, managed service providers (MSPs) fight for their customers’ attention, looking for ways to make them stay and purchase more services. One way to encourage that behavior is to develop a dependable brand of prod…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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