Runtime.exec()  in Java not working in Oracle 10 Application Server

Advertisement

Hi ,
I am trying to call a .exe file which is in the Web Application folder .
I am Using Process p = Runtime.exec("path to .exe file ")
This code is working fine when used with JBOSS , but not working with Oracle Application server .
Please tell me whether i need to do any chnages to make it work
Thanks in advance .

Advertisement

I ran a quick test with your code, I just had to make some small changes, and things work for me...
I'm testing with JDeveloper 10g 10.1.3.2.0 ...
The only thing I wonder is DBUser DBPass DBHost, those are not the actual values, correct?, neither they are environment variables?...
In the server hosting your OAS, you should try running the whole CMD line from the start/run dialog ... make sure it works in that server ...
Here is the code used in my test:
In JSP:
  <%@ page import="runexepkg.*" %>
  <% 
  String msg = "";
  try
  RunEXE p = new RunEXE();
  msg = p.main1();
  catch(Throwable t)
     System.out.println("Exception Raised");
     t.printStackTrace();
  %>
  <%= msg %>In Java Class:
package runexepkg;
import java.sql.*;
public class RunEXE
    String ss="";
    public String main1()
    try
        Runtime rt=Runtime.getRuntime();
        Process p = rt.exec("CMD /C start C:\\oraappserver\\j2ee\\WebGis\\applications\\PowerGis\\web\\WEB-INF\\classes\\GisProject\\cust_data_1.exe DBUser DBPass DBHost");
        System.out.println("Command has been executed");
        Class.forName("oracle.jdbc.driver.OracleDriver");
        Connection con = DriverManager.getConnection("jdbc:oracle:thin:@DBHost:DBPort:orcl","DBUser","DBPass");
        System.out.println("Test Connection ========== "+con);
        Statement st = con.createStatement();
        ResultSet rs = st.executeQuery("SELECT SYSDATE FROM DUAL");
        if(rs.next())
            ss="Command has been executed - Database has been accessed";
        else
            ss="Command has been executed - Database was not accessed";
    catch(Throwable t)
        System.out.println("Exception raised, command has NOT been executed");
        ss="Exception raised, command has NOT been executed";
        t.printStackTrace();
    return ss;
}Edited by: Rodolfo Ferrari on Jul 23, 2009 10:40 PM

November 30, -0001

Runtime.exec()  in Java not working in Oracle 10 Application Server

Hi , I am trying to call a .exe file which is in the Web Application folder . I am Using Process p = Runtime.exec("path to .exe file ") This code is working fine when used with JBOSS , but not working with Oracle Application server . Please tell

Browser not working in Oracle Applicaiton Server

Hye,Anybody Help me? i configure Oracle Application Server fine,but from IE browser or Netscape Browser when i do any thing it give me ... " download plugins " ,so how can i solve it thanking you BrijeshHello Dear, i got the problem and it is wi

The Runtime.exec methods doesn't work well on Solaris ???

I have two threads and I set the different running time. I use Runtime.exec to a run the command and use Process to get the process. It works properly in the windows2000 platform. However, when I transfer the platform to Solaris...and run the program

Can apex work without the oracle applications server? How?

My question is just what the title says. Can apex work without the Oracle applications server? I've heard it needs a web server to work but not necessarly the oracle applications server. Is it true? With ONLY apache installed can apex work on top of

Oracle application server backup

hi friends I am working on oracle application server 10g environment. i regularly taking backup of infrastructure tire using RMAN . and monthly operating system backup of file systems. Is there any other method through i can backup application server

Select * from tab is not working in oracle 10g

select * from tab is not working in oracle 10g. But at the same time, select * from <<table>> is working. Please advise me.This works for me in 10.2.0.2 Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production

Triggers not working in Oracle 9iAS

The form triggers are not working in oracle 9i AS. My Application server has Linux operating system with oracle form/report server installed. I am able to upload the form in the client machine (using Internet Explorer Win98 OS). Also i can feed in th

Sum function do not work in oracle reports enhanced spreadsheet format

we are using oracle reports 10.1.2.3 in our oracle application server 10gr2 and we are creating enhanced spreed sheet.And the report opens in MS excel fine.But we can not apply any formula like VALUE,SUM,AVG on that report after opening it into excel

Deploying  Jave portlet on Oracle Application Server 10g

I have installed Oracle 10g Application server, donwloaded and installed JDevleoper 9.0.5.1 and the latest Java Portal Development and as well as the JDeveloper portlet-addin. Now, I followed the instructions from the http://portalstudio.oracle.com/p

Could not start the Oracle Forms Server

I am using Windows 2000 Professional The Oracle Forms Server [Forms60Server] service failed to start due to the following error: Access is denied. Event ID: 7000 Source: Service Control Manager Description: Could not start the Oracle Forms Server [Fo

My camera works with the photobooth and with skype but does not work with online applications such as "lolcam from facebook" or "faceonthehole" application. Please help

My camera works with the photobooth and with skype but does not work with other applications like the "lolcam" from facebook or the " faceonthe hole" application. Can anyone help?There was a issue with school computers being used to sp

Forms Program units don't work in Oracle Apps Server 10.1.2.2

Dear all, I created a simple form with some triggers and a button. Everything works fine when I run the form using my PC's local OC4J. If I deploy the form in Oracle Application server 10.1.2.2 and run from there, none of the triggers or program unit

BO & Oracle Application Server

Post Author: amr_foci CA Forum: Deployment i've a Business Objects System installe on a server machine (A), and an Oracle Application Server installed on Server machine (B),,,can i deploy the business objects system on the oracle application server i

500 Internal Server Error on IBM AIX for Oracle Application Server 10g

Hi all, I have installed Oracle AS 10g on IBM AIX 5.3.After installation everything was working fine.After some time when i was trying to access the emd console for deploying the application it gives me following error:w/o asking for user name(ias_ad

Oracle Application Server of R12.1.x (10.1.3) for Custom Application Deploy

Hi Friends, Can we use Oracle Application Server of R12.1.x (10.1.3) for Custom Application Deployment(jar files) instead of going for seperate Oracle 10g Applicatuion Server. Let us know the Licensing information as well Regards DBHi, Personally i w

How to improve the performance of applications in Oracle Application Server 9i ?

I have my applications deployed to Oracle 8.1.7 database using OSE in Oracle Application Server 9i. My machine has 256 MB RAM. It has both Oracle Application Server and Oracle 8i database server installed on it. When I try running my applications I f

Error starting Oracle Application server

Hi I installed Oracle application server 10g. I successfully installed it. But when i stopped the opmn and emctl process and now when i am trying to start i am able to successfully start but when i type the URL of OAS Admin console. I get following e

Deploying a web service on Oracle application server

Hi; I was able to create the .wsdl file from Elipse using Java 1.3. I was not able to connect to the oracle Application server from eclipse is there any other way to deploy the web server. Can anyone advise with the steps to deploy a web service on O

What versions of Oracle Application Server suite to install on Windows 2008

Hello everyone! Now I want to install Oracle Application Server on Windows Server 2008. I downloaded 10.1.3.1.0 SOA suite, and also downloaded the patchset for 10.1.3.4, I'm working on windows server 2008,its version is 6.0. and 11g database release(

ORA-44356 when running report from Oracle Application Server 10g

All, We have some reports that we developed using Reports Builder 10g. We use a few program units that run with every record that use the exec_sql package to run dynamic sql in a remote database. Everything runs fine when we test the reports in Repor