Execute Extermal Command - run Sikuli script - wrong exit code

Hey,
i wrote a teststep which execute an external commad:
im using this parameters:
COMMAND [String]: "C:\\Sikuli\\runsikulix.cmd" -r "C:\\Sikuli\\Test_1.sikuli"
EXPECTED_EXIT_CODE[Integer]: 0
LOCAL[Boolean]: true
TIMEOUT_IN_MILISECS[Integer]: 10000
When i just run the test case the sikuli script is executed well, but the exit code is ever 0.
When i say exit(99) in my Sikuli script. Jubula still receive the exit code 0 and marked the teststep as successfull.
What i'm doing wrong?

Hi,
this may be connected to [1] and [2].
Please keep in mind that the ub_app_executeExternalCommand action is not really designed to deal with parameters when executing an external command.
A workaround can be to have different files which include the actual command + the parameter.
Regards
Oliver
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=470982
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=470983

Similar Messages

  • Running sqlplus scripts from Java code?

    hi
    I need to programmatically run sqlplus scripts from Java code on a machine that doesn't have sqlplus installed.
    Is there any Java class library available for doing this?

    The Ant approach could probably work for me, thanks for the tip.
    The setup seems rather complex however, given the simplicity of the task. I would prefer just running a Java based SQL*Plus from in a separate process or doing this via an API that would allow me to run SQL*Plus scripts (parse script, substitute variables, run statements).
    Oracle SQL Developer v1.1 appears to include an API that does exactly this.
    The ScriptParser, Substitution and SQLPLUS classes in the oracle.dbtools.raptor.scriptrunner package (oracle.sqldeveloper.jar) seem to do just what I need based on my tests.
    Can I use these classes for this purpose in my application? Is repackaging allowed?
    Does Oracle have any plans for releasing this sort of functionality separately e.g. as part of the Instant Client?

  • Installing SQL Server 2008 R2 via command line - setup100.exe returned exit code 0x84BC06B2

    I am receiving an exit code 0x84BC06B2 when installing SQLExpress via the command line on a PC that also has SQL Server 2012 installed.  Below is the log file generated:
    11/18/2014 01:02:41.631 Help display: false
    11/18/2014 01:02:41.642 Checking to see if we need to install .Net version 2.0
    11/18/2014 01:02:41.653 Determining the cluster status of the local machine.
    11/18/2014 01:02:41.665 The local machine is not configured as a cluster node.
    11/18/2014 01:02:41.675 Attempting to find media for .Net version 2.0
    11/18/2014 01:02:41.686 .Net version 2.0 is installed
    11/18/2014 01:02:41.697 RedistMSI::GetExpectedBuildRevision - Setup expects MSI 4.5.6001.22159 at the minimum
    11/18/2014 01:02:41.709 Attempting to get Windows Installer version
    11/18/2014 01:02:41.721 Windows Installer version detected: 5.0.7601.18493
    11/18/2014 01:02:41.733 RedistMSI::IsVistaRTM - Not Vista RTM build
    11/18/2014 01:02:41.745 Required version of Windows Installer is already installed
    11/18/2014 01:02:41.772 Strong name verification disabling is not required
    11/18/2014 01:02:41.781 /? or /HELP or /ACTION=HELP specified: false
    11/18/2014 01:02:41.793 Help display: false
    11/18/2014 01:02:41.805 Attempting to launch landing page workflow
    11/18/2014 01:02:41.816 Attempting to set setup mutex
    11/18/2014 01:02:41.827 Setup mutex has been set
    11/18/2014 01:02:41.838 Attempting to launch global rules workflow
    11/18/2014 01:02:41.849 Media source: c:\sqlexpress\
    11/18/2014 01:02:41.860 Install media path: c:\sqlexpress\x86\setup\
    11/18/2014 01:02:41.870 Media layout: Core
    11/18/2014 01:02:41.881 Attempting to get execution timestamp
    11/18/2014 01:02:41.892 Timestamp: 20141118_010240
    11/18/2014 01:02:41.903 Attempting to run workflow RUNRULES /RULES=GlobalRules
    11/18/2014 01:02:41.915 Attempting to launch process c:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\SQLServer2008R2\x86\setup100.exe
    11/18/2014 01:02:50.467 Process returned exit code: 0x00000000
    11/18/2014 01:02:50.484 Workflow RUNRULES /RULES=GlobalRules returned exit code: 0x00000000
    11/18/2014 01:02:50.496 Attempting to launch component update workflow
    11/18/2014 01:02:50.509 Media source: c:\sqlexpress\
    11/18/2014 01:02:50.522 Install media path: c:\sqlexpress\x86\setup\
    11/18/2014 01:02:50.534 Media layout: Core
    11/18/2014 01:02:50.546 Attempting to get execution timestamp
    11/18/2014 01:02:50.558 Timestamp: 20141118_010240
    11/18/2014 01:02:50.570 Attempting to run workflow COMPONENTUPDATE
    11/18/2014 01:02:50.581 Attempting to launch process c:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\SQLServer2008R2\x86\setup100.exe
    11/18/2014 01:03:02.572 Process returned exit code: 0x00000000
    11/18/2014 01:03:02.590 Workflow COMPONENTUPDATE returned exit code: 0x00000000
    11/18/2014 01:03:02.602 Attempting to launch user requested workflow locally
    11/18/2014 01:03:02.614 Attempting to find local setup.exe
    11/18/2014 01:03:02.626 Local bootstrap folder path: c:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\
    11/18/2014 01:03:02.639 Local setup100.exe full path: c:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\SQLServer2008R2\x86\setup100.exe
    11/18/2014 01:03:02.650 Media source: c:\sqlexpress\
    11/18/2014 01:03:02.661 Install media path: c:\sqlexpress\x86\setup\
    11/18/2014 01:03:02.672 Media layout: Core
    11/18/2014 01:03:02.684 Attempting to get execution timestamp
    11/18/2014 01:03:02.695 Timestamp: 20141118_010240
    11/18/2014 01:03:02.706 Attempting to run user requested action from local setup100.exe
    11/18/2014 01:03:02.717 Attempting to launch process c:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\SQLServer2008R2\x86\setup100.exe
    11/18/2014 01:07:28.302 Process returned exit code: 0x84BC06B2
    11/18/2014 01:07:28.314 Local setup100.exe returned exit code: 0x84BC06B2
    11/18/2014 01:07:28.326 Attempting to release setup mutex
    11/18/2014 01:07:28.338 Setup mutex has been released
    11/18/2014 01:07:28.351 Setup closed with exit code: 0x84C40013
    11/18/2014 01:07:28.362 ======================================================================
    Does anyone have any ideas of why this is failing?

    Here is the summary.txt:
    Overall summary:
      Final result:                  SQL Server installation failed. To continue, investigate the reason for the failure, correct the problem, uninstall SQL Server, and then rerun SQL Server Setup.
      Exit code (Decimal):           -2068052302
      Exit facility code:            1212
      Exit error code:               1714
      Exit message:                  SQL Server installation failed. To continue, investigate the reason for the failure, correct the problem, uninstall SQL Server, and then rerun SQL Server Setup.
      Start time:                    2014-11-18 01:03:03
      End time:                      2014-11-18 01:07:23
      Requested action:              Install
      Log with failure:              C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141118_010240\Detail.txt
      Exception help link:           http%3a%2f%2fgo.microsoft.com%2ffwlink%3fLinkId%3d20476%26ProdName%3dMicrosoft%2bSQL%2bServer%26EvtSrc%3dsetup.rll%26EvtID%3d50000%26ProdVer%3d10.50.1600.1%26EvtType%3d0xE53883A0%400xBE03358B%401306%4023
    Machine Properties:
      Machine name:                  PC81372
      Machine processor count:       4
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x86
      Process architecture:          32 Bit
      OS clustered:                  No
    Product features discovered:
      Product              Instance             Instance ID                    Feature                
                     Language             Edition              Version         Clustered 
      Sql Server 2008      SQLEXPRESS           MSSQL10.SQLEXPRESS             Database Engine Services                 1033      
              Express Edition      10.2.4000.0     No        
      Sql Server 2008      SQLEXPRESS           MSSQL10.SQLEXPRESS             SQL Server Replication                   1033      
              Express Edition      10.2.4000.0     No        
    Package properties:
      Description:                   SQL Server Database Services 2008 R2
      ProductName:                   SQL Server 2008 R2
      Type:                          RTM
      Version:                       10
      SPLevel:                       0
      Installation location:         c:\sqlexpress\x86\setup\
      Installation edition:          EXPRESS
    User Input Settings:
      ACTION:                        Install
      ADDCURRENTUSERASSQLADMIN:      True
      AGTSVCACCOUNT:                 NT AUTHORITY\NETWORK SERVICE
      AGTSVCPASSWORD:                *****
      AGTSVCSTARTUPTYPE:             Disabled
      ASBACKUPDIR:                   Backup
      ASCOLLATION:                   Latin1_General_CI_AS
      ASCONFIGDIR:                   Config
      ASDATADIR:                     Data
      ASDOMAINGROUP:                 <empty>
      ASLOGDIR:                      Log
      ASPROVIDERMSOLAP:              1
      ASSVCACCOUNT:                  <empty>
      ASSVCPASSWORD:                 *****
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:            <empty>
      ASTEMPDIR:                     Temp
      BROWSERSVCSTARTUPTYPE:         Automatic
      CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141118_010240\ConfigurationFile.ini
      CUSOURCE:                      
      ENABLERANU:                    True
      ENU:                           True
      ERRORREPORTING:                False
      FARMACCOUNT:                   <empty>
      FARMADMINPORT:                 0
      FARMPASSWORD:                  *****
      FEATURES:                      SQLENGINE,REPLICATION
      FILESTREAMLEVEL:               0
      FILESTREAMSHARENAME:           <empty>
      FTSVCACCOUNT:                  <empty>
      FTSVCPASSWORD:                 *****
      HELP:                          False
      IACCEPTSQLSERVERLICENSETERMS:  True
      INDICATEPROGRESS:              False
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files\Microsoft SQL Server\
      INSTALLSQLDATADIR:             <empty>
      INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
      INSTANCEID:                    WORKSTUDIO
      INSTANCENAME:                  WORKSTUDIO
      ISSVCACCOUNT:                  NT AUTHORITY\NetworkService
      ISSVCPASSWORD:                 *****
      ISSVCSTARTUPTYPE:              Automatic
      NPENABLED:                     0
      PASSPHRASE:                    *****
      PCUSOURCE:                     
      PID:                           *****
      QUIET:                         True
      QUIETSIMPLE:                   False
      ROLE:                          AllFeatures_WithDefaults
      RSINSTALLMODE:                 FilesOnlyMode
      RSSVCACCOUNT:                  NT AUTHORITY\NETWORK SERVICE
      RSSVCPASSWORD:                 *****
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:                         *****
      SECURITYMODE:                  SQL
      SQLBACKUPDIR:                  <empty>
      SQLCOLLATION:                  SQL_Latin1_General_CP1_CI_AS
      SQLSVCACCOUNT:                 NT AUTHORITY\NETWORK SERVICE
      SQLSVCPASSWORD:                *****
      SQLSVCSTARTUPTYPE:             Automatic
      SQLSYSADMINACCOUNTS:           BUILTIN\USERS
      SQLTEMPDBDIR:                  <empty>
      SQLTEMPDBLOGDIR:               <empty>
      SQLUSERDBDIR:                  <empty>
      SQLUSERDBLOGDIR:               <empty>
      SQMREPORTING:                  False
      TCPENABLED:                    1
      UIMODE:                        AutoAdvance
      X86:                           False
      Configuration file:            C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141118_010240\ConfigurationFile.ini
    Detailed results:
      Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      MSI status:                    Failed: see details below
      MSI error code:                1714
      MSI log file location:         C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141118_010240\sql_engine_core_shared_loc_Cpu32_1033_1.log
      MSI error description:         The older version of SQL Server 2008 R2 Database Engine Shared cannot be removed.  Contact your technical support group.  
      Configuration status:          Failed: see details below
      Configuration error code:      0xBE03358B@1306@23
      Configuration error description: Could not find the Database Engine startup handle.
      Configuration log:             C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141118_010240\Detail.txt
      Feature:                       SQL Server Replication
      Status:                        Failed: see logs for details
      MSI status:                    Passed
      Configuration status:          Failed: see details below
      Configuration error code:      0xBE03358B@1306@23
      Configuration error description: Could not find the Database Engine startup handle.
      Configuration log:             C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141118_010240\Detail.txt
    Rules with failures:
    Global rules:
    Scenario specific rules:
    Rules report file:               C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141118_010240\SystemConfigurationCheck_Report.htm

  • Running Shell Scripts within Java code!!!

    Hi,
    How do I run a shell script from my Java code???
    Also I need to ensure my next line of Java code is executed only after the shell script has finished executing.
    Since my shell script just cuts out some line for a txt file and then only my Java code parses the cut-out file section and processes certain info.
    Please help!!!
    Thanks!!!

    Runtime.exec and, if you need your Java to stop until the external executable is complete, Process.waitFor.
    And you'll want to read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • SCCM 2012 application run Powershell script and return codes

    Hi,
    I created an new application (imported as MSI) in SCCM 2012R2. After import I changed the deployment type installation program to run a Powershell script: powershell.exe -ExecutionPolicy Unrestricted -File "Install FactSet 2013 5I.ps1
    My goal is to close some processes before installing the MSI. This works. But on a failure the application program also return code 0 (AppEnforce.log). Is it possible to pass the MSI return codes to SCCM.
    Maybe anyone had the same or idea's to solve this? Thanks in advance.
    Regards,
    Peter
    Powershell script code:
    $ExitCode=0
    Function
    Stop-RunningApplication{
    Param(
    [parameter(Mandatory
    =$true)]
    [string]$ProcessName#
    Specify process names separated by commas
    # Split multiple processes on a comma and join with the regex operator '|' to perform "or" match against
    multiple applications
    $processName=$processName-split(",")
    -join("|")
    $process=Get-Process|Where{
    $_.ProcessName
    -match$processName}
    |Stop-Process-Force
    #Stop running processes
    Stop-RunningApplication
    -ProcessName"excel,outlook,fdsw32,marquee,POWERPNT,WINWORD"
    #Install FactSet 2013 5I
    $ExitCode
    =(Start-Process".\FactSet_Setup_2013_5I_x644.msi"'/qn
    FACTSET_CLOSE_PROCESSES=1 /l*v C:\Temp\InstFac20135I.log'-Wait-Passthru).ExitCode
    Environment]::Exit($ExitCode)
    Peter vd Bosch

    It's really hard to tell from the code above because of the way it's listed, but are sure that even executes? I see at least one stray curly brace and a stray square bracket.
    For the Start-Process cmdlet, have you tried without the -passthru parameter?
    Also, using the actual parameters will make the code much more readable instead of relying on position.
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • Run Program activity not exiting

    I'm running SCOrch 2012 R2 and am having trouble with a runbook hanging. Here are the facts
    My runbook executes a script (the code for which, I have included below) that gets a list of AD users and exports that list to a .csv file. 
    When run manually, from a Powershell window, the script executes and returns the expected file, before returning to the prompt.
    When run through the SCOrch, the script runs fine, with the output file created and the Powershell process exiting.
    The commands I'm using to execute the script manually and through the runbook, are the same (see below) and the run-as accounts are the same.
    The runbook never gets past the step that runs the Powershell script.
    The activity looks like this: 
    Command execution
    Command: cmd.exe /c | C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe –c "C:\it\getADUserProperties-Parameterized.ps1 -SearchPath 'ou=customer,dc=domain,dc=tld' -DomainName domain.tld | Export-Csv C:\it\userList.csv -NoTypeInformation"
    Run as account credentials specified
    The rest of the options are set to the default values
    The question is, why doesn't the Run Program activity close when powershell.exe exits? I know it won't matter, but here is the script anyway:
    <#
    .Synopsis
    Get Active Directory user list with a user-specified set of properties
    .DESCRIPTION
    Get a list of Active Directory users from a user-specified list of containers (or the root of the domain) and return a user-specified set of attributes.
    This script can connect to non-native domains (domains that the executing computer is not a member of) if DNS is configured properly. If accessing a
    non-native domain, the script will prompt for credentials.
    .NOTES
    Author: Mike Hashemi
    V1 date: 15 August 14
    .LINK
    .PARAMETER DomainName
    Defines which DNS domain to connect to.
    .PARAMETER SearchPath
    Default value = cn=users,dc=domain,dc=tld. This parameter represents the AD to search and can contain multiple values.
    .PARAMETER OutputProperties
    Default value = Name,Enabled. This parameter represents a comma-spearated list of AD attributes to return.
    .EXAMPLE
    .\getADUserProperties-Parameterized.ps1 -DomainName domain.tld
    This example will output the name and enabled status of all users in "cn=users,DC=domain,DC=tld" and below.
    .EXAMPLE
    .\getADUserProperties-Parameterized.ps1 -OutputProperties name,telephoneNumber | Export-Csv C:\userList.csv -NoTypeInformation
    This example will output the name and telephone number of all users in "cn=users,DC=domain,DC=tld" and below. Output will be sent to c:\userList.csv.
    #>
    [CmdletBinding()]
    param(
    [Parameter(Mandatory=$True)]
    [string]$DomainName,
    [string[]]$SearchPath = 'cn=users,DC=domain,DC=tld',
    [string]$OutputProperties = 'Name,Enabled'
    Import-Module ActiveDirectory
    If ((Get-Module ActiveDirectory -ErrorAction SilentlyContinue) –eq $null) {
    Write-Error "This script requires the Powershell Module: 'ActiveDirectory'. Please make sure you've got the correct tools installed."
    Exit
    Else {
    Foreach ($ou in $SearchPath) {
    Try {
    Write-Verbose ("Getting users from {0}." -f $ou)
    Get-ADUser -Filter * -SearchBase $ou -Properties $OutputProperties.Split(",") -Server $DomainName | Select $OutputProperties.Split(",")
    Catch [System.Security.Authentication.AuthenticationException] {
    Write-Output ("Connection failed. Prompting for credentials to {0}" -f $DomainName)
    $cred = Get-Credential -Message "Enter credentials for $DomainName."
    Write-Verbose ("Getting users from {0}. with user: {1}" -f $ou, $cred.Username)
    Get-ADUser -Filter * -SearchBase $ou -Properties $OutputProperties.Split(",") -Server $DomainName -Credential $cred | Select $OutputProperties.Split(",")
    Thanks.

    mhashemi,
    I had a simliar issue as you did where my runbook would run until it got to the "Run .Net Script" Activity and then the Runbook would just stop. What I found was you can not have the command "Exit" in your script. The command "Exit"
    will force the Activity to close and will not output any variables.
    I am not the only one to find this issue.
    Check out the article labeled
    "Run .Net Script (powershell), "exit" and published data" on technet under
    System Center Orchestrator > System Center Orchestrator - General
    (not able to post the link, I am restricted)
    Doesn't sound like there is going to be a fix anytime soon
    Hope this helps
    -Ozarkclay

  • Have terminal NOT run a script when it loads

    I recently wrote a basic shell script and saved it as a .command file to run from the desktop. Since then, whenever I open the terminal it automatically runs the script then exits the terminal. If I hide the file (mv pt-noplugs.command .ptnoplugs.command) it simply opens the terminal and closes it immediately. I have tried changing the default shell from bash to something else but this doesn't seem to make a difference. I also don't seem to have a .bashrc file when it normally is /home/user/.bashrc (I'm used to linux). Any help would be appreciated. Below is the script:
    # Shell Script to start Pro Tools HD with no waveshell Plug-In
    echo "*"
    echo "* Script: pt-noplugs.command"
    echo "* Please Leave This Window Open Until ProTools Has Exited"
    echo "*"
    # Move waveshell Plug-In Files to Plug-Ins (Unused)
    cd "/Library/Application Support/Digidesign/Plug-Ins/"
    mv -v Waveshell-DAE_5.9.1.dpm "../Plug-Ins (Unused)"
    # Start Pro-Tools
    /Applications/Digidesign/Pro\ Tools/Pro\ Tools\ HD.app/Contents/MacOS/Pro\ Tools\ HD
    # Restore Plug-Ins directory
    cd "../Plug-Ins (Unused)"
    mv Waveshell-DAE_5.9.1.dpm ../Plug-Ins
    echo "*"
    echo "* Thank You. This Window May Now Be Closed"
    echo "*"
    exit

    I forgot to add: when I login as a different user and load terminal is does NOT run the script mentioned before.

  • I have tried downloading about 6 times and this is the message I keep getting.  Pls. tell me what to do!!Exit Code: 7 Please see specific errors below for troubleshooting. For example,  ERROR:--- Summary -----  - 0 fatal error(s), 2 error(s)     ERROR: Th

    I have tried downloading about 6 times and this is the message I keep getting.  Pls. tell me what I am doing wrong
    Exit Code: 7
    Please see specific errors below for troubleshooting. For example, ERROR:
    -------------------------------------- Summary --------------------------------------
    - 0 fatal error(s), 2 error(s)
    ERROR: This installer does not support installation on a 64-Bit Windows operating system. Please download the 64-Bit version of Photoshop Elements.
    ERROR: System check returned with error : 6I have tried downloading about 6 times and this is the message I keep getting

    Exit Code: 6, Exit Code: 7 Installation Errors - http://helpx.adobe.com/creative-suite/kb/errors-exit-code-6-exit.html
    Troubleshoot with install logs | CS5, CS5.5, CS6 - http://helpx.adobe.com/creative-suite/kb/troubleshoot-install-logs-cs5-cs5.html for information on how to review your installation logs

  • Running Shell script from command line

    Hi,
    I am getting a Exception in thread "main" java.lang.NoClassDefFoundError: TestRuntime/java error when I run the following code on my linnux box...can anyone please help
    import java.io.*;
    public class TestRuntime {
            public static void main(String args[]) {
                    Runtime runtime = Runtime.getRuntime(); //get runtime information
            try {
                            Process Child = runtime.exec("/usr/bin/ksh"); // execute command
                            BufferedWriter outCommand = new BufferedWriter(new OutputStreamWriter(Child.getOutputStream()));
                            outCommand.write("/home/mypath/tesh.csh");
                            outCommand.flush();
                            try {
                                    Child.waitFor(); // wait for command to complete
                            } catch (InterruptedException e) { // handle waitFor failure
                                    System.out.println("ERROR: waitFor failure");
                                    System.exit(10); // exit application with exit code 10
                    } catch (IOException e) { // handle exec failure
                            System.out.println("ERROR: exec failure" + e);
                            System.exit(11); // exit application with exit code 11
    }

    If I'm reading your code correctly, you're starting a Korn shell session, then executing your C shell script as if you were at at the session window's prompt. If that is correct, you haven't caused your standard out (stdout) to hit ENTER yet. I'm not an expert, but I hope this works for you.
    Your code:
    Process Child = runtime.exec("/usr/bin/ksh"); // execute command
                            BufferedWriter outCommand = new BufferedWriter(new OutputStreamWriter(Child.getOutputStream()));
                            outCommand.write("/home/mypath/tesh.csh");
                            outCommand.flush();I think you need to enter one extra line before the flush():
    Process Child = runtime.exec("/usr/bin/ksh"); // execute command
                            BufferedWriter outCommand = new BufferedWriter(new OutputStreamWriter(Child.getOutputStream()));
                            outCommand.write("/home/mypath/tesh.csh");
                            outCommand.newLine();  // hit ENTER
                            outCommand.flush();P.S. If you're running this script and your Java program from the same UNIX machine, you could just execute the shell script inside the runtime.exec() call.

  • ORA-27369 Exit-Code: 255 when executing sql script as job

    Dear all
    I'd like to find and compile all invalid objects in an instance. This should be done every day as a scheduled job with the use of DBMS_SCHEDULER.
    For this, I set up the following sql-script:
    ---------start script--------------
    set heading off;
    set feedback off;
    set echo off;
    Set lines 999;
    Spool /tmp/run_invalid.sql
    select
    'ALTER ' || OBJECT_TYPE || ' ' ||
    OWNER || '.' || OBJECT_NAME || ' COMPILE;'
    from
    dba_objects
    where
    status = 'INVALID'
    spool off;
    set heading on;
    set feedback on;
    set echo on;
    @/tmp/run_invalid.sql
    exit
    ------ end script ----
    The script ist working well when executed manualy via sqlplus. As you can see, it spools the commands to a second file (run_invalid.sql) which is the beeing executed to compile the invalid objects found.
    I now want to schedule this script via DBMS_SCHEDULER (running the job every day at 7AM). Creation of the job:
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'compile_invalid_objects',
    job_type => 'EXECUTABLE',
    job_action => '/home/oracle/scripts/sql/compile_invalid_objects.sql',
    start_date => trunc(sysdate)+1+7/24,
    repeat_interval => 'trunc(sysdate)+1+7/24',
    enabled => TRUE,
    comments => 'SQL-Script, und invalid objects zu finden und zu kompilieren'
    END;
    Manualy execute and error message:
    BEGIN
    DBMS_SCHEDULER.RUN_JOB (job_name => 'compile_invalid_objects',
    use_current_session => true);
    END;
    FEHLER in Zeile 1:
    ORA-27369: Job vom Typ EXECUTABLE nicht erfolgreich mit Exit-Code: 255
    ORA-06512: in "SYS.DBMS_ISCHED", Zeile 150
    ORA-06512: in "SYS.DBMS_SCHEDULER", Zeile 441
    ORA-06512: in Zeile 2
    --> Sorry for this, I'm using german localized oracle.
    Unfortunately, it seems that only Shell-Scripts can be scheduled when using job_type='EXECUTABLE'. Can you confirm this?
    BTW: The script is chmoded to 777, therefore it can't be a permission problem.
    Is there maybe another solution with one single script using dbms_output functionality and run the script in a loop?
    To complete my post, here are the commands used to create and test the job:
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'compile_invalid_objects',
    job_type => 'EXECUTABLE',
    job_action => '/tmp/compile_invalid_objects.sql',
    start_date => trunc(sysdate)+1+7/24,
    repeat_interval => 'trunc(sysdate)+1+7/24',
    enabled => TRUE,
    comments => 'SQL-Script, und invalid objects zu finden und kompilieren'
    END;
    Thanks for your help
    Casi

    You could more simply use $ORACLE_HOME/dbms/admin/utlrp.sql

  • Error while executing a uinx script in BODS job - exit code 127

    I am executing a UNIX script using BODS job and it is giving an error message saying 'Program terminated because of exit code 127'. The same script i am able to execute in UNIX. I am not able to find the solution for this.

    Using a print command with return code 8 should give more insight to the error.
    print(exec('sh \bin','<your command>',8));

  • Applescript duplicate command runs different as an Application than from Script Editor

    Hi,
    When I run my script from the Script Editor it copies (duplicates) only the new files from one folder to the other one, as desired.  That is, when the file already exists in the destination folder, it just skips to the next one until they are all done.
    However, if I save that very same script as an Application and run it, Finder throws up a dialog box for each item telling me that it already exists and asks if I'd like to Keep Both, Stop or Replace the file.
    I can't figure out why it would run differently as a Script in Script Editor, to how it would run as an Application?  Can somebody please tell me where I'm going wrong? Or perhaps there has been a change in the way Finder and Applescript operate the Duplicate command in Yosemite?
    Interestingly, this problem has only started occurring since I updated to Yosemite.  Before that, on Mavericks, I didn't have this problem!  And I've also just tried the same thing on my other MacBook Pro that's running Mavericks and it works as intended.
    Thanks so much!

    I think the replacing parameter may be broken. The first time I run this:
    tell application "Finder"
      make new folder at desktop with properties {name:"newf"} with replacing
    end tell
    I get a new folder. The second and subsequent times, I get this:
    Unless I'm completely misunderstanding how to use the replacing parameter...

  • 4EA3 - ISSUE: run-as-script exits silently, deleting all text from "Script Output"

    I have a short-to-medium sized script I've been developing in SQL Developer 4 EA (build MAIN-13.30).
    It was going pretty well, then just when I was ready to verify the whole thing start to finish, it started silently aborting, deleting output.
    This happened several times with the script.  Because output is deleted, I can't tell definitively when it failed.
    The log messages include pairs of messages matching the runs:
    SEVERE
    3088
    0
    oracle.dbtools.worksheet.commands.scriptrunner.task.executor.DefaultStatementExecutorTask
    java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:261)
    SEVERE
    3087
    10046
    oracle.dbtools.raptor.newscriptrunner.ScriptRunnerContext
    java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:261)
    I perform a bit of unconventional handling of DEFINE variables and WHENEVER SQLERROR, but these have been in the script during successful runs.
    Andrew Wolfe

    You haven't provide ANY information about what the script is even trying to do, what database you are working with or what 'output' you are talking about being deleted.
    I suggest that you perform more troubleshooting on your own to determine more about the issue that might be involved.
    Use the 'binary search' method: cut the script in half and run the first half. If that works add half of the second half of the script (now using 75% of the script) and run that. Maybe 'divide and conquor' will isolate the particular part that is failing.,
    If you are using Oracle then execute the script in sql*plus. If it works there but doesn't work in sql developer that provides more info.
    Run the script in the latest OFFICIAL version of sql developer. If that works then the problem may be related to the un-released version you are using.
    Not much anyone on the forums can do for you unless you post info about what it is you are even doing.
    Because output is deleted, I can't tell definitively when it failed
    Then you need to be more proactive and add steps to the script that display, print or log each step that is executed. Then it is easy to tell which steps completed and which step failed.

  • Can servlets/ jsp automatically run perl scripts and executables?

    I'm a student and am new to to servlets and web programming in general.
    I need to know if it's possible to run perl scripts and executables automatically from servlets/ jsp.
    The program I am planning on creating should have a client outside a firewall that uploads perl files to a gateway machine inside the firewall, the servlet should be able to run this perl file, and then pass the resulting file as an argument to an executable, to be run by another servlet on a different server.
    I've tried looking everwhere for an answer to this and am about to revert to a cgi based approach because I'm not sure if it would work so any help/ suggestions would be much appreciated.

    Hallo,
    I think using java Runtime will help. you can do Processes that execute shell or system commands through
    Process process = Runtime.getRuntime().exec("your perl scripts here!");
    Bye

  • [SOLVED] Why some commands run properly in startup script others don't

    I am trying to finish setting up my MythTV box. I have the following commands to run at startup:
    #!/bin/sh
    # Stop spamming dmesg
    echo -n 0000:00:06.1 > /sys/bus/pci/drivers/ehci_hcd/unbind
    # Enable wake from remote
    echo enabled > /sys/bus/usb/devices/4-5/power/wakeup
    # Link optical drive to /dev/dvd (needed for myth)
    if [ ! -e /dev/dvd ]; then ln -s /dev/cdrom /dev/dvd; fi
    # Start LIRC
    echo lirc > /sys/class/rc/rc0/protocols
    ln -sf /run/lirc/lircd /dev/lircd
    lircd -d /dev/lirc0 /etc/lirc/hipermc
    # Start mythbackend
    mythbackend &
    # Start LCD server
    LCDd &
    I have tried making this part of rc.local and also as a startup item in XFCE (with script called using passwordless sudo since it requires root permissions). In each case, only some of the commands run properly (the dmesg, wake from remote, and start LIRC sections). The other commands don't seem to work. However if I run the script manually after the computer has finished booting, everything works perfectly. Can anyone help me figure out what's going wrong?
    It seems like path is already set since some commands do work without the full pathname. Also please don't suggest using systemd for starting the daemons - it does not work for me with LIRC or lcdproc and there is a driver bug with my hardware that keeps me from using the mythbackend systemd service.
    Thanks in advance for the help.
    Last edited by mosquitogang201 (2012-12-16 14:42:11)

    The exec command was what I needed. Was able to follow the error messages to find out the command im using under "stop spamming dmesg" was messing everything else up. Also I am running systemd - just not using it to start these items since the systemd service files weren't working reliably.
    Anyways this brings me to another question - is there a more elegant way to stop dmesg from getting spammed? About 5 times per second I get the error
    hub 2-4:1.0: unable to enumerate USB device on port 3
    which makes it very difficult to look through dmesg logs to find an actual problem.
    EDIT: Just needed to add the sleep command after the dmesg section to give the kernel enough time to reload using ohci_hcd. Now script is working perfectly. Marking as SOLVED.
    Last edited by mosquitogang201 (2012-12-16 14:48:47)

Maybe you are looking for

  • Reg. Jobwork charges and Stock of WIP not updated

    Dear Experts In our development system,when I create Process order ( with E & L combination) the following accounts is created 221402      Stock of WIP 504031      GR/IR Clg-Job work 315001      Inc/Dec in WIP 412103      Jobwork Charges but I have c

  • How can i copy all SMS and Imessage from my old iphone(4s) to my new iphone(6plus)?

    I have over 8000 SMS in my 4s, so I want copy all of it to my 6plus but I dont know how to do that p/s: sorry about my Eng ^^

  • Re: Sync problems with Tour on PC

    I'm having the same problem and don't understand the reply.  I'm switching from a PalmPilot where I could sync and print my calendar on Outlook to the BlackBerry and I can't get a hard copy.  Frustrated!  Please help.

  • JAXB2+Maven2 compilation problem

    Hello there, First of all, any hint to this issue will be greatly appreciated, I'm badly strugling with it. Project: Building a webapp Development: Vista, jdk 1.6, Eclipse 3.3 and some plugins including Maven2+Jetty On this env everything goes fine,

  • Change screen fields properties

    Hi all, I am using a loop screen to change the properties of some teh fields od the following screen: SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-003. PARAMETERS: cb_af_e  AS CHECKBOX USER-COMMAND abc. PARAMETERS: p_pep LIKE anla-posnr,