Problem while trying to execute Java class in JSP using  RunTime Class

Hi,
I want to execute a JAVA class through a JSP. For this I am using following code ....
JSP (AAA.jsp) CODE ............
try
String[] cmd = new String[3];
cmd[0] = "cmd.exe" ;
cmd[1] = "/C" ;
cmd[2] = "java -DPeBS_CONFIG_HOME=D:/CASLIntegration/PeBS/srcvob/PeBS/config Service_Statement_Application 22/May/2001 22/May/2003";
Runtime rt = Runtime.getRuntime();
System.out.println("Execing " + cmd[0] + " " + cmd[1] + " " + cmd[2]);
Process proc = rt.exec(cmd);
// any error message?
StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");
// any output?
StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
// kick them off
errorGobbler.start();
outputGobbler.start();
// any error???
int exitVal = proc.waitFor();
System.out.println("ExitValue: " + exitVal);
catch (Throwable t)
t.printStackTrace();
StreamGobbler THread class Code ..........
import java.util.*;
import java.io.*;
public class StreamGobbler extends Thread
InputStream is;
String type;
StreamGobbler(InputStream is, String type)
this.is = is;
this.type = type;
public void run()
try
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line=null;
while ( (line = br.readLine()) != null)
System.out.println(type + ">" + line);
} catch (IOException ioe)
ioe.printStackTrace();
I have successfully compiled and placed the class file for the above class in JSP's servlet engine. However, when I execute the JSP through explorer Web Browser, I get following compile time error:
An error occurred between lines: 36 and 86 in the jsp file: /casl/LocalApp/VehicleServiceStmt/AAA.jsp
Generated servlet error:
D:\Tomcat\work\localhost\_\casl\LocalApp\VehicleServiceStmt\AAA$jsp.java:118: No constructor matching StreamGobbler(java.io.InputStream, java.lang.String) found in class StreamGobbler.
StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");
^
An error occurred between lines: 36 and 86 in the jsp file: /casl/LocalApp/VehicleServiceStmt/AAA.jsp
Generated servlet error:
D:\Tomcat\work\localhost\_\casl\LocalApp\VehicleServiceStmt\AAA$jsp.java:121: No constructor matching StreamGobbler(java.io.InputStream, java.lang.String) found in class StreamGobbler.
StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
I am unable to determine the reason of why the constructor which exists in the StreamGobbler Class is not recevied in JSP. If I try to write the same code in JSP as a JAVA class, keeping StreamGobler class same, the programme executes successfully.
Please help me find solution to this at the earliest. Thanks in advance,
Prachi

Thanks,
I got it working by making the constructor Public.
-Prachi

Similar Messages

  • Script getting hang while trying to execute update command in python using cx_oracle

    Hi All,
    My script is getting hang while executing below script and it is not throwing any error.
    TEMP_PROD_cur=TEMP_PROD_schema_conn.cursor()
    sql="update APP_DB_CONNECT set DRIVER=:driver,URL=:url where APPNAME=:appname and CONNECT_NAME=:connect_name"
    TEMP_PROD_cur.execute(sql,{'driver':driver_name,'url':jdbc_url,'appname':app_name,'connect_name':connect_name})
    TEMP_PROD_schema_conn.commit()
    I tried several ways to prepare update statement to execute but the script is getting hang in all the ways.
    Please help to resolve this issue.

    There's not enough info provided to be able to tell what's going on.  You can find online ways to troubleshoot Oracle lock issues - if this is what you are experiencing.

  • Problem while trying to load or access OracleTypes.CURSOR value

    Hi all,
    I configured my datasource as follow
    URL:  jdbc:oracle:thin:@192.10.1.230:1521:interp
    Driver Class Name: oracle.jdbc.xa.client.OracleXADataSource
    an my namedquery is
    +@NamedNativeQuery(name = "generaFoliosRenCot",+
    *+               query = "{ ? = call pkg_renovaciones.fn_rencot_auto(:ageid) }",+*
    *+               resultClass = FoliosGenerados.class,+*
    *+               hints = { @javax.persistence.QueryHint(name = "org.hibernate.callable", value = "true") })+*
    I'm using
    <org.springframework.version>3.0.5.RELEASE</org.springframework.version>
    <org.hibernate.version>3.5.4-Final</org.hibernate.version>
    <com.oracle.jdbc.version>10.2.0.4.0</com.oracle.jdbc.version>
    Weblogic 10.3.4
    when i run my app on junit its run fine
    but when i run my app on weblogic server the problem is when i call a function on oracle 9i the error is:
    +*[02/08/2011 10:00:00 ERROR ServiceThrowsAdvice:doRecoveryActionDataAccess:26] - :::: ** ::::Problem while trying to load or access OracleTypes.CURSOR value; nested exception is org.hibernate.HibernateException: Problem while trying to load or access OracleTypes.CURSOR value*+
    +*org.springframework.orm.hibernate3.HibernateSystemException: Problem while trying to load or access OracleTypes.CURSOR value; nested exception is org.hibernate.HibernateException: Problem while trying to load or access OracleTypes.CURSOR value*+
         at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:679)
         at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
         at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
         at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
         at mx.grupocp.inter.model.dao.impl.FoliosGeneradosDaoImpl.generaFoliosRenCot(FoliosGeneradosDaoImpl.java:28)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
         at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
         at $Proxy206.generaFoliosRenCot(Unknown Source)
         at mx.grupocp.inter.controller.scheduler.jobs.impl.ExecuteShellsImpl.generaFoliosRenovCot(ExecuteShellsImpl.java:86)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
         at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
         at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
         at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
         at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:80)
         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
         at java.lang.Thread.run(Thread.java:619)
    *+Caused by: org.hibernate.HibernateException: Problem while trying to load or access OracleTypes.CURSOR value+*
         at org.hibernate.dialect.Oracle9Dialect.registerResultSetOutParameter(Oracle9Dialect.java:308)
         at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1609)
         at org.hibernate.loader.Loader.doQuery(Loader.java:717)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
         at org.hibernate.loader.Loader.doList(Loader.java:2294)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2172)
         at org.hibernate.loader.Loader.list(Loader.java:2167)
         at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:316)
         at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1832)
         at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
         at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:179)
         at mx.grupocp.inter.model.dao.impl.FoliosGeneradosDaoImpl$1.doInHibernate(FoliosGeneradosDaoImpl.java:34)
         at mx.grupocp.inter.model.dao.impl.FoliosGeneradosDaoImpl$1.doInHibernate(FoliosGeneradosDaoImpl.java:29)
         at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
         ... 37 more
    +*Caused by: java.lang.IllegalAccessException: Class org.hibernate.dialect.Oracle9Dialect can not access a member of class oracle.jdbc.driver.OracleTypes with modifiers ""*+
         at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
         at java.lang.Class.newInstance0(Class.java:349)
         at java.lang.Class.newInstance(Class.java:308)
         at org.hibernate.dialect.Oracle9Dialect.registerResultSetOutParameter(Oracle9Dialect.java:306)
         ... 50 more
    please help me

    Hi,
    Have a look at this tread:
    Re: Problems of hibernate calling oracle stored procedure
    Regards peter

  • JCO.Server Error while trying to execute a RFC program from SAP

    Hi,
    We are connecting to an external registered server program from SAP via Web Methods.
    The external server program is registered with the SAP Gateway. We have created a TCP/IP RFC destination and are able to connect to the destination successfully via SM59.
    An RFC function is created in SAP and is called using the syntax CALL FUNCTION "/NGN/BAPI_STRE_SEARCH_PROCESS" DESTINATION 'PRDB2B'. We have also handled the COMM_FALIURE and SYSTEM_FALIURE exceptions in the function call.
    We are monitoring the gateway via SMGW and see a connection log to the RFC destination as below
    Number - 10
    LUname - dev01
    TPName - sapgw00
    User - KRAORANE
    Status - CONNECTED
    Symbolic - PRDB2B
    Conversation - 86520353
    Prot - REG
    SAP return code - 0
    CPIC rtn code - 0
    The external program returns results as expected.
    However sometimes the RFC fails and returns the message “JCO.Server could not create server function /NGN/BAPI_STRE_SEARCH_PROCESS”.
    We are not able to figure what exactly is causing this error. Any help will be highly appreciated.
    -Kiran

    Hi,
    Please see the below links..
    JCO.Server Error while trying to execute a RFC program from SAP
    Re: JCO.Servcer could not find server function
    Re: JCO.Server could not find server function 'SET_SLD_DATA'
    /people/kathirvel.balakrishnan2/blog/2005/07/26/remote-enable-your-rfchosttoip-to-return-host-ip-to-jco
    Re: interfacing SAP with an existing java applications
    http://help.sap.com/saphelp_nw04/helpdata/en/47/80f671ee6e4b41b63c0fe46bd6e4f8/content.htm
    http://www.sapgenie.com/faq/jco.htm
    Regards
    Chilla..

  • Im facing problem while trying to update my iphone 4 from version 4.3.1 to iOS 5. While processing the downloaded 774mb file, it comes with the statement that the network connection timed out. why???

    im facing problem while trying to update my iphone 4 from version 4.3.1 to iOS 5. While processing the downloaded 774mb file, it comes with the statement that the network connection timed out. why???

    i have been dealing with this same issue, tried to  turn off firewall and even turn of antivirud but still it gave me the same error.

  • Problem while trying to install OVI suite

    Hi, guys! How you doing? I've got a problem while trying to install OVI Suite: I'm getting a warning signal that says "Something got wrong - Nokia Ovi Suite installations require that PC Connectivity solution 7.0.0.0 or a later version to be already installed before continuing installation" and I can't install after that. I've been searching at Google, but I have found nothing. Hope you can help me. Thanks in advance.
    Attachments:
    error.png ‏7 KB

    Many thanks : I had  been directed to this file already, but it was the french version, with many translation mistakes that made it unusable. Much clearer in english.
    I have
    Again the tab problem !
    Message Edité par chilly charly le 12-06-2005 02:45 PM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Error While trying to Run load test  on OATS using Command prompt

    Getting the below error message while trying to execute command line to start OATS load test.
    log4j:WARN No appenders could be found for logger (oracle.oats.server.jndi.JndiL
    ookup).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more in
    fo.
    Error initializing controller connection to t3://rws21410019.us.oracle.com:8088/
    weblogic\n\n(message id=ctl.initError)
    oracle.oats.client.controller.ControllerException: Error initializing controller
    connection to t3://rws21410019.us.oracle.com:8088/weblogic\n\n(message id=ctl.i
    nitError)
            at oracle.oats.app.controller.client.ControllerClient.initController(Con
    trollerClient.java:268)
            at oracle.oats.app.controller.client.ControllerSyncedClient.<init>(Contr
    ollerSyncedClient.java:137)
            at oracle.oats.app.controller.client.OltCommandLine.<init>(OltCommandLin
    e.java:43)
            at oracle.oats.client.CommandLine.initController(CommandLine.java:748)
            at oracle.oats.client.CommandLine.run(CommandLine.java:179)
            at oracle.oats.client.CommandLine.main(CommandLine.java:61)
    Caused by: javax.naming.AuthenticationException [Root exception is java.lang.Sec
    urityException: User: weblogic, failed to be authenticated.]
            at weblogic.jndi.internal.ExceptionTranslator.toNamingException(Exceptio
    nTranslator.java:42)
            at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLIni
    tialContextFactoryDelegate.java:788)
            at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialCo
    ntextFactoryDelegate.java:682)
            at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialCon
    textFactoryDelegate.java:469)
            at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
    tialContextFactoryDelegate.java:376)
            at weblogic.jndi.Environment.getContext(Environment.java:315)
            at weblogic.jndi.Environment.getContext(Environment.java:285)
            at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
    extFactory.java:117)
            at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
            at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
            at javax.naming.InitialContext.init(Unknown Source)
            at javax.naming.InitialContext.<init>(Unknown Source)
            at oracle.oats.server.jndi.JndiLookup.createInitialContextInternal(Unkno
    wn Source)
            at oracle.oats.server.jndi.JndiLookup.createInitialContext(Unknown Sourc
    e)
            at oracle.oats.server.jndi.JndiLookup.createInitialContext(Unknown Sourc
    e)
            at oracle.oats.app.session.SessionClient.initSession(SessionClient.java:
    104)
            at oracle.oats.app.controller.client.ControllerClient.initController(Con
    trollerClient.java:262)
            ... 5 more
    Caused by: java.lang.SecurityException: User: weblogic, failed to be authenticat
    ed.
            at weblogic.common.internal.RMIBootServiceImpl.authenticate(RMIBootServi
    ceImpl.java:116)
            at weblogic.common.internal.RMIBootServiceImpl_WLSkel.invoke(Unknown Sou
    rce)
            at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.jav
    a:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Please make sure the OLT server is running!
    Thanks

    This issue was resolved after changing the user name to "oats" this is the user name of weblogic server and not the OATS console.

  • Execute an external program using Runtime class

    How to execute an external java program using Runtime class?
    I have used ,
    Process p=Runtime.getRuntime().exec("c:/j2sdk1.4.0/bin/helloworld.java ");
    But it throws a runtime IOException error:2 or error:123.
    Help me with the code. Thanks in advance.

    Create Runtime Object and attach to system process.Try this code
    import java.io.*;
    public class ExecuteExternalApp {
      public static void main(String args[]) {
                try {
                    Runtime rt = Runtime.getRuntime();
                    //Process pr = rt.exec("cmd /c dir");
                    Process pr = rt.exec("c:\\ yamessenger.exe"); //give a valid exe file
                    BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                    String val=null;
                    while((val=input.readLine()) != null) {
                        System.out.println(val);
                    int exit = pr.waitFor();
                    System.out.println("Exited with error code "+exit);
                } catch(Exception e) {
                    System.out.println(e.toString());
                    e.printStackTrace();
    }Edited by: anishtomas on Feb 3, 2009 9:34 PM
    Edited by: anishtomas on Feb 3, 2009 9:37 PM

  • Executing a command using Runtime Class

    How to execute a command on a differnet machine with different ipaddress using Runtime Class
    My code is
    String[] cmd = new String[3];
    cmd[0] = "192.1...../c:/WINNT/system32/cmd.exe" ;
    cmd[1] = "/C" ;
    cmd[2] = args[0];
    Runtime rt = Runtime.getRuntime();
    System.out.println("Execing " + cmd[0] + " " + cmd[1]
    + " " + cmd[2]);
    Process proc = rt.exec(cmd);
    // any error???
    int exitVal = proc.waitFor();
    System.out.println("ExitValue: " + exitVal);
    This is not Working

    I have same issue. Actually when I use cmd.exe /c set in java code and if I run the java code in DOS propmt, it retrieves all latest user Environment variable values. But if I run the code in windows batch file, it is not retrieveing the latest user environment values until I reboot my computer, Do you know how to get user environment value with out rebooting machine??????

  • Error occures while Sap R/3 sytem triggers XI message (using proxy class)

    <b>Error occures while Sap R/3 sytem triggers XI message (using proxy class)</b>
    1- I prepared message in XI side
    2- I used sproxy transaction in R/3 side and generate proxy class
    3- I used necessary methods in Abap program in R/3 side
    4- Somethimes, message does not work and generate error like below
    What must I do to solve this problem.  Thanks
    <u><b>Error message (Reported in SXMB_MONI in Sap R/3 side)</b></u><?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:ErrorHeader xmlns:SAP="http://sap.com/exchange/MessageFormat">
      <SAP:Context />
      <SAP:Code p1="112" p2="HTTPIO_PLG_ICM_CONNECT_FAILED-Fehlermeldung beim Senden der Daten." p3="" p4="">HTTP.HTTP_CLIENT_SEND_FAILED</SAP:Code>
      <SAP:Text language="TR">Error during http send: Error code: 112 Error text: HTTPIO_PLG_ICM_CONNECT_FAILED-Fehlermeldung beim Senden der Daten.</SAP:Text>
      </SAP:ErrorHeader>

    Hi,
    Check thiss
    /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
    Error no 2
    Regards
    Aashish Sinha
    PS : Reward points if helpful

  • FTP using Runtime class ...Please Help ??

    Hi,
    I am trying to ftp a file programatically.
    I am trying to use Runtime class but facing problems
    in it.This is what I am trying to do :
    Runtime rr = Runtime.getRuntime();
    String[] cmds = new String[2];
    cmds[0]="username=rahmed";
    cmds[1]="password=prpas";
    try{
    Process p = rr.exec("ftp 192.168.1.18",cmds);     
    rr.exec("put vv.txt");
    This does not work ??
    Is there any way to make it work ? Or is there any
    other way to ftp a file programatically ??
    Thanks in adavance..
    Regards
    Rais

    Under Linux/Unix at least, it is good to use the switches -n and -i with the ftp client acually meant for intercative usage.
    -i Turns off interactive prompting during multiple file transfers.
    -n Restrains ftp from attempting ``auto-login'' upon initial connection.
    I do "user <myuser> <mypassword>" then from the script.
    I am happily using ftp this way from shell-scripts in my projects.
    scp is however better than ftp: it does not send plain text passwords over the net, it support key-based login, its encrypts the data.

  • Java.sql.sqlexception ora24344 error while trying to load Java class

    Hi Guys,
    I am getting "java.sql.sqlexception ora24344 error" while trying to load a java class using sql developer. Due to sensitivity of the code I am unable to post the code here but has anyone experienced a similar error before?
    Thanks

    Hi,
    ora-24344 is known. It means it compiled but there are errors. Because you are not telling which version of Oracle you use, it is hard. Also you couldn't provide code will not make it easy. A common error is not having the right right on packages of SYS, such as UTL_* or DBMS_SYS_SQL. Can you maybe give the line of your code which produces the error?
    Herald ten Dam
    http://htendam.wordpress.com

  • Error while trying to execute a unix shell script from java program

    Hi
    I have written a program to execute a unix shell script in a remote machine. I am using J2ssh libraries to estabilish the session connection with the remote box.The program is successfully able to connect and authenticate with the box.
    The runtime .exec() is been implemented to execute the shell script.I have given below the code snippet.
    try {
         File file_location = new File("/usr/bin/");
         String file_location1 = "/opt/app/Hyperion/scripts/daily";
         String a_mib_name = "test.sh";
         String cmd[] = new String[] {"/usr/bin/bash", file_location1, a_mib_name};
         Runtime rtime = Runtime.getRuntime();
         Process p = rtime.exec(cmd, null, file_location);
    System.out.println( "Connected to the server1" );
    BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line = br.readLine();
    while(line !=null)
    System.out.println(line);
    line = br.readLine();
    br.close();
    p.getErrorStream ().close ();
    p.getOutputStream().close();
    int retVal = p.waitFor();
    System.out.println("wait " + retVal);
    //session.executeCommand("ls");
    catch (IOException ex) {
    I get an error message
    Connected to the server
    java.io.IOException: Cannot run program "/usr/bin/bash" (in directory "\usr\bin"
    ): CreateProcess error=3, The system cannot find the path specified
    at java.lang.ProcessBuilder.start(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at SftpConnect.main(SftpConnect.java:143)
    Caused by: java.io.IOException: CreateProcess error=3, The system cannot find th
    e path specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    I am sure of the file path where the bash.sh and test.sh are located.
    Am i missing something? Any help would be greatly appreciated.
    Thanks
    Senthil

    Hi, I am using a simple program to connect to a RMI server and execute shell script. I use the Runtime.exec aommand to do the same.
    The script is sh /tmp/pub/alka/test.sh /tmp/pub/alka/abc/xyz/ul ul
    The script when run from the server, gives no errors. But when ran using rthe above method in java, gives errors as follows,
    Mycode:
    String command = "/bin/sh /tmp/pub/alka/test.sh /tmp/pub/alka/abc/xyz/ul ul";
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(command);
    int exitVal = proc.exitValue();
    System.out.println("Process exitValue: " + exitVal);
    java.io.IOException: CreateProcess: /bin/sh /tmp/pub/alka/test.sh /tmp/pub/alka/abc/xyz/ul ul error=3
         at java.lang.ProcessImpl.create(Native Method)
         at java.lang.ProcessImpl.<init>(Unknown Source)
         at java.lang.ProcessImpl.start(Unknown Source)
         at java.lang.ProcessBuilder.start(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at DecryptTest.main(DecryptTest.java:18)
    Can anyone please help

  • Problem while trying to get meta data from entity in CRM 2011 using java

    Hi,
    I have been trying to get the meta data from entity. Below is the code what i have tried.                                 
    EntityFilters entfilter = new EntityFilters();
    EntityFilters_type0 eftypes [] = new EntityFilters_type0[]{EntityFilters_type0.Attributes};
    entfilter.setEntityFilters_type0(eftypes);
    EntityFiltersE entityFiltersE = new EntityFiltersE();
    entityFiltersE.setEntityFilters(entfilter);
    Boolean RAIP = new Boolean(true);
    OrganizationServiceStub.ParameterCollection parameterCollection = new OrganizationServiceStub.ParameterCollection();
    OrganizationServiceStub.KeyValuePairOfstringanyType entityFilters = new OrganizationServiceStub.KeyValuePairOfstringanyType();
    entityFilters.setKey("EntityFilters");
    entityFilters.setValue(entityFiltersE);
    OrganizationServiceStub.KeyValuePairOfstringanyType retAsIfPublished = new OrganizationServiceStub.KeyValuePairOfstringanyType();
    retAsIfPublished.setKey("RetrieveAsIfPublished");
    retAsIfPublished.setValue(RAIP);
    parameterCollection.addKeyValuePairOfstringanyType(entityFilters);
    parameterCollection.addKeyValuePairOfstringanyType(retAsIfPublished);
    OrganizationServiceStub.OrganizationRequest request=new OrganizationServiceStub.OrganizationRequest();
                request.setRequestName("RetrieveAllEntities");
                request.setParameters(parameterCollection);
                OrganizationServiceStub.Execute org_execute = new OrganizationServiceStub.Execute();
                org_execute.setRequest(request);
    ExecuteResponse resp  =  serviceStub.execute(org_execute);
    And getting the below error.
    [ERROR] The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter
    http://schemas.microsoft.com/xrm/2011/Contracts/Services:request. The InnerException
    message was 'Element value from namespace http://schemas.datacontract.org/2004/07/System.Collections.Generic cannot have child contents to be deserialized as an object. Please use XmlNode[] to deserialize this pattern of XML.'.  Please see
    InnerException for more details.
    Please help me if any one have an idea on this error.
    Thanks in advance.

    Hi
    Did you get this resolved ?

  • PDE-UJ1001, while trying to import java classes.

    Hi,
    When I try to import java classes into forms using the java
    importer, I get an error stating PDE-UJ1001-Failed to create
    JVM. I tried installing a patch in Developer 2000(Path 4a). But
    still it doesnt work. Could anybody guide me in this?
    Thanks,
    Karthick.

    am getting similar error - my dba has suggested that oracle developer uses the jvm from ie4 but i'm sure that cant be true as i thought the jvm was built in.
    could somebody out there clarify this or inform me whats missing..
    error
    from dev 6i forms builder (6.0.8.11.3) on 8i (8.1.7.2.0) when trying to select option 'import java classes' from program menu returns error 'PDE-UJ1001 Failed to create the JVM.'
    regards and thanks in anticipation....
    vin ferguson

Maybe you are looking for

  • How to insert a flying image in a video

    How to insert flying images  in a video...someone it's speaking in the left side and in the right side some flying pictures are coming, staying for 2-3 seconds one by one....some ideas??? Like the weather forecast...you have someone in the left side

  • HP Color Laserjet CM1312nfi MFP and OSX Yosemite

    Hello all. I have a HP Color Laserjet CM1312nfi MFP, and i can't install it on OSX 10.10 Yosemite. When i plug in the USB cable, nothing happens. My Mac does not find the printer, and i can't install driver from HP's website. All USB ports in my Mac

  • Drag and drop images using tilelist in flex

    i just want the working code for drag and drop images using tilelist in flex

  • ESS/MSS leave approve view is diaplaying as error

    Hi All, We are using ESS/MSS for leave request and approval process. We did neccessary configuration for the same. I have created leave request in ESS successfully and the same request displayed as item in UWL/Task. When try to approve, by clicking t

  • How can I format a date

    I want to know how to format a date in the way: 21 de junio de 2013 I mean I want to insert the word "de" between dd and mmmm and between mmmm and yyyy. Can anyone help me please? Thanks in advance