Solved

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

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
spring dependency injection using java config 2 91
Java Exception example issues 11 84
if statement not resolving in my code 5 56
ejb on wildfly 5 46
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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