Solved

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Stuck in Bootstrap WysiHtml Editor 3 39
TreeSet comparator example 7 95
javax.naming.NameNotFoundException: Name ... is not bound in this Context. 6 266
runtime exception 2 30
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
Each year, investment in cloud platforms grows more than 20% (https://www.immun.io/hubfs/Immunio_2016/Content/Marketing/Cloud-Security-Report-2016.pdf?submissionGuid=a8d80a00-6fee-4b85-81db-a4e28f681762) as an increasing number of companies begin to…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 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