Restart/start/stop network from command line

Hi all...
How do I restart/start or stop my network from command line? I red somewhere about using netstart, but I guess the article was refering to OpenBSD and not OS X...
So.. any hints?
Thanks.

Hey You are right there...
OKK..To my knowledge, you can start an application, from the servlet in a thread. But stopping a thread from outside is not safe and even sun doesn't advice.
1. Starting a thread : you can start your program using an Runtime class. But your client program can see if the server port is open or not. So after starting the server program, through servlet, execute the client program. OR you can log every command/step in to a log file, and start the server program and see the log, where currently the program is waiting, so you can check, if the server program has exited.
2. Stoping an application i.e a thread is a tricky thing. One i would suggest is, send data to the server socket with your pass code and the command "Shutdown" with a sequence which will not repeat in the data communication. If the first command is your passcode and "Shutdown" you can kill the server thread from inside the server application. To make this possible, every thing the new connection is accepted, you have to validate the first line is this your command to shutdown.
and repeat the step 1.
Hope this gives you a little idea to proceed. if not let me know...
Cheers
Venkat

Similar Messages

  • To run an application on iAS6sp1 on HP-Unix, while starting the kjs from command line, it gives a GDS error and crashes. Subsequently, after stopping all services and restarting iAS wouldnot come up.

     

    Hi,
    Not a problem, please post the KJS error logs for me to hunt the
    exact reason for the error.
    Thanks & Regards
    Raj
    Neel John wrote:
    To run an application on iAS6sp1 on HP-Unix, while starting the kjs
    from command line, it gives a GDS error and crashes. Subsequently,
    after stopping all services and restarting iAS wouldnot come up.
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Use frmweb.exe to start a form from command line

    Following the following doc "start any Oracle Forms component from the command line"
    http://www.oracle.com/webapps/online-help/forms/10g/state/content/navId.3/navSetId._/vtTopicFile.f1_help%7Cbldr_dev_opts%7Cstart_fb_comps_cmd~html/
    I tried the following two command line
    D:\DevSuiteHome\BIN>frmweb module=c:\files\orders userid=scott/tiger@r12
    D:\DevSuiteHome\BIN>frmbld module=c:\files\orders userid=scott/tiger@r12
    The frmbld successfully brought up the forms builder and open the orders forms.
    But the frmweb did not bring up anything. I wonder if there are other parameters I need to provide rather than just module and userid......
    I looked into the html of the form applet, and wondering if passing all the parameters would be sufficient enough for the frmweb to start
    <PARAM NAME="serverArgs"
    VALUE="escapeParams=true module=c:\files\orders.fmx userid= sso_userid=%20 sso_formsid=%25OID_FORMSID%25 sso_subDN= sso_usrDN= debug=no host= port= buffer_records=no debug_messages=no array=YES obr=YES query_only=no quiet=yes render=no record= tracegroup= log= term=">
    So I did this from command line, but still nothing.....
    D:\DevSuiteHome\BIN>frmweb.exe escapeParams=true module=c:\files\orders.fmx userid=scott/tiger@r12 sso_userid=%20 sso_formsid=%25OID_FORMSID%25 so_subDN= sso_usrDN= debug=no host= port= buffer_records=no debug_messages=no array=YES obr=YES query_only=no quiet=yes render=no record= tracegroup= log= term=

    That is a bug in the documentation. You can only start Forms from a URL starting from 9.0.2.

  • Error starting managment server from command line

    I tried to start the managment server from the command line like this:
    <jvm_home>/bin/jrcmd <pid start_management_server
    and I'm getting the following error:
    <pid> Not enough storage is available to run this command
    The system has plenty or resources. I'm unsure what storate the command refers too.
    The pid was found by using tasklist /svc at the command line to find the pid matching the domain service name.
    this is jrockit 1.42_13

    What operating system are you on? What is the complete version of JRockit ("java -version" will tell)?
    Regards,
    /Staffan

  • Starting and Stopping FMLE from command line yields corrupt .flv files

    I am using FMLE to record and live stream TV content. In order to this I am remotely calling FMLEcmd in order to start and stop encoding processes. The problem that I am running in to is that the .flv files generated are corrupt. The odd thing is that if I use the exact same profile XML from the GUI, then the encoding process works just fine and results appear as intended.
    Here is the way my workflow works:
    I start the process by calling
    FMLEcmd /p C:\lighttpd\htdocs\xml\default.xml /l C:\lighttpd\htdocs\logs\log.txt
    then at the conclusion of the recording I call
    FMLEcmd /s "C:\lighttpd\htdocs\files\default.flv"
    When I attempt to open the files using FFmpeg I get a codec error saying that no codecs were detected. When I attempt to open the files in VLC I get a error saying that the media types are "Undf". When I attempt to open or modify the files with flvtool2 I get an end-of-file error. My guess is that my stop command is incorrect and somehow abruptly stopping the stream, but I don't know another way to stop the stream. Do I need to specify a specific stream duration in the XML and make sure to call the stop command *after* the duration has been reached? What would cause this codec corruption when the same profile works properly from the GUI?
    Here is the profile I am attempting to use.
    <?xml version="1.0" encoding="UTF-16"?>
    <flashmedialiveencoder_profile>
        <preset>
            <name>Custom</name>
            <description></description>
        </preset>
        <capture>
            <video>
            <device>Osprey-440 Video Device 1A</device>
            <crossbar_input>0</crossbar_input>
            <frame_rate>20.00</frame_rate>
            <size>
                <width>640</width>
                <height>480</height>
            </size>
            </video>
            <audio>
            <device>SigmaTel Audio</device>
            <crossbar_input>0</crossbar_input>
            <sample_rate>22050</sample_rate>
            <channels>1</channels>
            <input_volume>75</input_volume>
            </audio>
        </capture>
        <process>
            <video>
            <preserve_aspect></preserve_aspect>
            <deinterlace></deinterlace>
            </video>
        </process>
        <encode>
            <video>
            <format>VP6</format>
            <datarate>650;</datarate>
            <outputsize>640x480;</outputsize>
            <advanced>
                <keyframe_frequency>5 Seconds</keyframe_frequency>
                <quality>Best Quality - Lower Framerate</quality>
                <noise_reduction>None</noise_reduction>
                <datarate_window>Medium</datarate_window>
                <cpu_usage>Dedicated</cpu_usage>
            </advanced>
            <autoadjust>
                <enable>false</enable>
                <maxbuffersize>1</maxbuffersize>
                <dropframes>
                <enable>false</enable>
                </dropframes>
                <degradequality>
                <enable>false</enable>
                <minvideobitrate></minvideobitrate>
                <preservepfq>false</preservepfq>
                </degradequality>
            </autoadjust>
            </video>
            <audio>
            <format>MP3</format>
            <datarate>48</datarate>
            </audio>
        </encode>
        <restartinterval>
            <days></days>
            <hours></hours>
            <minutes></minutes>
        </restartinterval>
        <reconnectinterval>
            <attempts></attempts>
            <interval></interval>
        </reconnectinterval>
        <output>
            <file>
            <limitbysize>
                <enable>false</enable>
                <size>10</size>
            </limitbysize>
            <limitbyduration>
                <enable>false</enable>
                <hours>0</hours>
                <minutes>60</minutes>
            </limitbyduration>
            <path>C:\lighttpd\htdocs\files\default.flv</path>
            </file>
        </output>
        <metadata>
            <entry>
            <key>author</key>
            <value></value>
            </entry>
            <entry>
            <key>copyright</key>
            <value></value>
            </entry>
            <entry>
            <key>description</key>
            <value></value>
            </entry>
            <entry>
            <key>keywords</key>
            <value></value>
            </entry>
            <entry>
            <key>rating</key>
            <value></value>
            </entry>
            <entry>
            <key>title</key>
            <value></value>
            </entry>
        </metadata>
        <preview>
            <video>
            <input>
                <zoom>100%</zoom>
            </input>
            </video>
            <audio></audio>
        </preview>
        <log>
            <level>100</level>
            <directory>C:\Documents and Settings\Administrator\My Documents\My Videos</directory>
        </log>
    </flashmedialiveencoder_profile>

    If issue of corrupt file after cmd line not in GUI mode. Are you using some automation to copy/paste output flv to someother location?
    AFAIK, after placing stop command, FMLE took some time to write proper EOF in FLV. wait ~10 sec for FMLE to complete file writing process and than play in FLV PLayer.
    I tried manually with steps you mentioned and it's working fine for me.I playerd file in Applian Flash PLayer. "http://www.applian.com/flvplayer/"

  • How to programatically start j2ee application/service  from command line

    Hi all
    We have developed a j2ee application and deployed  the .ear file on SAP J2EE (Netweaver'04) engine.
    We are able to successfully start/stop the application from Visual administrator -> Deploy -> Service -> Start application (or) Stop application.
    We need to start and stop the same application programatically or via command line instead of doing it from VA.  Any thoughts from anyone on how to do it ?
    Thanks in advance.
    Regards
    Nagesh

    The cammands are there in the respective folders, these are just the batch files / .sh scripts that can be run from command line.
    /usr/sap/<instance>JC<client>/j2ee/admin
    go.sh and go.bat can run either on command line
    j2ee/configtool
    configtool.sh / configtool.bat  
    similarly for other smaller utilities. For the main server, the related commands are in exe directory of sapmnt
    /sapmnt/<instance>/exe
    Regards,
    Nitin
    Edited by: Nitin Mahajan on Jun 16, 2009 11:16 PM

  • How to shutdown startup 11g OEM/GRID from Command Line

    Please describe how to shutdown and startup OEM/GRID 11g from command line and how to startup all of its services. Thanks in advance!

    After a some tests i found this method...
    SHUTDOWN
    srvctl stop listener -l LISTENER_NAME
    srvctl stop database -d DBNAME
    srvctl stop diskgroup -g VGGROUP
    srvctl stop asm
    crsctl stop has
    STARTUP
    crsctl start has
    srvctl start asm
    srvctl start database -d DBNAME
    Pls try before to use it and i hope it isn't late...

  • NIMAX generate report from command line

    Dear users,
    I would like to generate MAX report ("MAX Generate Report.vi") from command line. Does nimax.exe have this capability, or do I have to write a wrapper to vi ?
    Regards.
    Solved!
    Go to Solution.

    Dear ramjeev
    to solve your problem you can try two aproaches
    1. instal new verzion of MAX
    you can download the newest verzion of MAX from the link
    http://joule.ni.com/nidu/cds/view/p/id/2328/lang/e​n
    This distribution includes the following products:
    NI System Configuration 1.2.0
    NI Measurement & Automation Explorer 4.8.0
    NI Network Browser 1.1.0
    2. clean up corrupted max database and start with new one
    you have a step by step solution on the link
    http://digital.ni.com/public.nsf/allkb/86256F0E001​DA9FF86256FFD005B827C?OpenDocument
    Hope it will help you.

  • I can not uninstall Office 2013 from command line

    Hi, I have been stuck for a while trying to uninstall Office 2013 via command line. Installation file was downloaded from Volume Licensing Service Center, Uninstall.xml file for silent uninstallation looks like this:
    <Configuration Product=”ProPlus”>
    <Display Level=”basic” CompletionNotice=”yes” SuppressModal=”yes” AcceptEula=”yes” />
    </Configuration>
    From command line the following will not work:
    setup /uninstall ProPlus /config .\ProPlus.ww\Uninstall.xml
    Error: Setup can not find or validate an installation file. Please try reinstalling Office . . .
    setup /uninstall ProPlus gives me GUI to continue process - it seems /config .\ProPlus.ww\Uninstall.xml part does not work as it should be
    This is very important to me since I used above command line in SCCM 2012 R2 to allow user to uninstall Office 2013 by itself via Software Center. When this failed I tried locally but the error was the same. This should have been trivial task - silent uninstallation
    using .xml file. It is not a rocket science. I am very angry because losing time for something like this is unacceptable for system engineers working with SCCM 2012 R2.

    Hi,
    This error might occurs due to lots of reasons. Where is the installation file stored? If it's stored on a network share, please copy it to your local disk, and then manually run the command again. This way, we'll see if the installation file is the
    problem.
    If issue persists in this case, then this generally means that something wrong with the installation file. Please try to redownload it and then try again.
    Please also make sure that you're executing the command with elevated privileges (run as administrator).
    Regards,
    Ethan Hua
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • How to run a 10g report from command line ?

    Good Afternoon,
    Please advise if there is a way to run a 10g report from command line.
    We use 6i right now and our job scheduler runs reports using "D:\ORADEV6I\BIN\RWRUN60.EXE ..." executable in batch mode on a separate server. We plan to migrate to 10g Database, Forms, Reports. Is there a way to keep this functionality and create a "command" to address an report server and run a report?
    Thank you,
    Dmitri

    Steps to take.
    (1.) In command prompt type RWSERVER SERVER=repserver1 to star the rep server.
    (2.) If you get "Javaw.exe The procedure entry point psoasyn could not be located in the dynamic link library orapls10.dll." error do one of the following
            (a.) Type the full name for the server. D:\OracleDevR2\bin\rwserver SERVER=repserver1
                   or, if it does not work
            (b.) Add D:\OracleDevR2\bin to the system env. variable PATH
    (3.) Start OC4j
    (4.) Now you can access the jobs using URL like:
        http://192.161.11.143:8890/reports/rwservlet/showjobs?server=repserver1
          where 192.161.11.143 is your machine's IP address.

  • Not able to start managed server from command prompt

    Hi,
    I am trying to start manged server from command prompt. The command i am using is as follows:
    startManagedWebLogic.cmd MS1 [http://]&lt;Listen_Address&gt;:&lt;Admin_port&gt;
    Where MS1 is the name of my managed server.
    But i am getting following exceptions:
    There are 1 nested errors:
    weblogic.management.ManagementException: Unable to obtain lock on C:\bea\user_pr
    ojects\domains\PB530Domain\servers\AdminServer\tmp\AdminServer.lok. Server may a
    lready be running
    at weblogic.management.internal.ServerLocks.getServerLock(ServerLocks.ja
    va:159)
    at weblogic.management.internal.ServerLocks.getServerLock(ServerLocks.ja
    va:58)
    at weblogic.management.internal.DomainDirectoryService.start(DomainDirec
    toryService.java:73)
    at weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesMan
    ager.java:459)
    at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServ
    icesManager.java:164)
    at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:711)
    at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:482)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:440)
    at weblogic.Server.main(Server.java:67)
    >
    <Feb 10, 2009 6:48:16 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server sta
    te changed to FAILED>
    <Feb 10, 2009 6:48:16 PM IST> <Error> <WebLogicServer> <BEA-000383> <A critical
    service failed. The server will shut itself down>
    <Feb 10, 2009 6:48:16 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server sta
    te changed to FORCE_SHUTTING_DOWN>
    Please help me to resolve this issue.
    thanks,
    Sonal
    Edited by: [email protected] on Feb 10, 2009 5:16 AM

    Looking at your error message a little closer, I don't believe it has anything to do with port conflicts but rather that even though you are executing the startManagedWeblogic.cmd with your managed server name (MS1), the error indicates that it is trying to start the Admin Server (not MS1). Note in your error message the following: Unable to obtain lock on C:\bea\user_pr
    ojects\domains\PB530Domain\servers\AdminServer\tmp\AdminServer.lok. Server may a
    lready be running
    It is saying that it cannot start the Admin Server because it is already running (which is probably true in your case). Have you made any changes to the startManagedWeblogic.cmd or the startWeblogic.cmd scripts? I would start debugging there and try to figure out why the script is trying to start your admin server instead of MS1 as you requested on the cmd line.

  • Problem with tokenized  input from command line

    I am trying to take an input from the command line, parse it to tokens and perform whatever operation is needed depending on the name of the token, on a binary tree of stacks for example, if i type 1 2 1 3 printLevelOrder, then the root of the tree should have 3, 2,1 in the stack, the left child should have 1 and the right child should be empty. and then a level order print of the tree should be performed.
    however what is happening when i run this code is the numbers are being put into the right stacks of the tree, but any commands such as printLevelOrder or PrintPopRoot are entering the code that is for placing numbers onto the stack instead of executing that command and skipping past this piece of code.
    so my question is, why is the if statement if (word =="printLevelOrder") not being executed when thats whats in the word ?
    example input and output shown below code fragment.
              try {
                  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                 String line = "";
                 while (line != "***") {
                      System.out.print("> prompt ");
                      line = in.readLine();
                      StringTokenizer tokenizer = new StringTokenizer(line," ");
                      String word = new String();
                      while (tokenizer.hasMoreTokens()) {
                             word = tokenizer.nextToken();
                             boolean notCommand = true;
                             if (word =="printLevelOrder") {
                                  theTree.printLevelOrder();
                                  System.out.println("(word ==printLevelOrder)");
                                  notCommand=false;
                             if (word == "printPopLevelOrder") {
                                  theTree.printPopLevelOrder();
                                  notCommand=false;
                             if (word == "printPopInorder") {
                                  theTree.printPopInorder();
                                  notCommand=false;
                             if (word == "printPopPreorder") {
                                  theTree.printPopPreorder();
                                  notCommand=false;
                             if (word == "printPopRoot") {
                                  theTree.printPopRoot();
                                  notCommand=false;
                             if (word == "***") {
                                  notCommand=false;
                             if (notCommand == true) {
                                  System.out.println("(notCommand == true)");
                                  boolean notPlaced = true;
                                  int v = 1;
                                  while ((notPlaced==true) && (v < theTree.size())) {
                                       if (theTree.element(v).isEmpty()) {
                                            theTree.element(v).push(Integer.valueOf(word));
                                            System.out.println("Inserting"+word);
                                            System.out.println("in empty stack at location: "+v);
                                            notPlaced=false;
                                       if (notPlaced==true) {
                                            if (  Integer.valueOf(word) >= Integer.valueOf( theTree.element(v).top().toString() )  ) {
                                                 theTree.element(v).push(Integer.valueOf(word));
                                                 System.out.println("Inserting"+word);
                                                 System.out.println("in stack at location: "+v);
                                                 notPlaced=false;
                                       v++;
              }valid inputs: int value, printLevelOrder, printPopLevelOrder, printPopInorder, p
    rintPopPreorder, printPopRoot, *** to quit
    prompt 1 3 2 4 2 printLevelOrder(notCommand == true)
    Inserting1
    in empty stack at location: 1
    (notCommand == true)
    Inserting3
    in stack at location: 1
    (notCommand == true)
    Inserting2
    in empty stack at location: 2
    (notCommand == true)
    Inserting4
    in stack at location: 1
    (notCommand == true)
    Inserting2
    in stack at location: 2
    (notCommand == true)
    Exception in thread "main" java.lang.NumberFormatException: For input string: "printLevelOrder"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:447)
    at java.lang.Integer.valueOf(Integer.java:553)
    at TreeStack.main(TreeStack.java:73)
    Press any key to continue . . .

    lol aww, shame that you forgot to do that. i had 10 / 10 for mine, and seing as the deadline is now well and trully over,
    here is the entire source for anybody who was following the discussion or whatever and wanted to experiment.
    additional files needed >
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/Stack.java
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/ArrayStack.java
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/StackEmptyException.java
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/StackFullException.java
    /*TreeStack.java - reads command line input of values and assigns them to stacks in a  binary tree and performs
    operations on the ADT. valid inputs: <int>,   printLevelOrder,   printPopLevelOrder,
    printPopInorder,   printPopPreOrder,   printPopRoot.         Terminates on invalid input.
    Written by George St. Clair.
    S/N:0208456         22/11/2005
    import java.util.Vector;
    import java.io.*;
    import java.util.StringTokenizer;
    public class TreeStack {
         private final int TREE_CAPACITY = 7 + 1;
         private final int STACK_CAPACITY = 10;
         Vector tree = new Vector(TREE_CAPACITY) ;
         //collect input from command line, add values to stacks at nodes of the teee
         //and perform required operations on the treestack
         public static void main (String [] args) {
              //create a tree of stacks
              TreeStack theTree = new TreeStack ();
              try {
                   //collect standard input
                  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                 String line = "";
                 while (line != null) {
                        System.out.print("");
                      line = in.readLine();
                      //tokenise input
                      StringTokenizer tokenizer = new StringTokenizer(line," ");
                      String word = new String();
                      while (tokenizer.hasMoreTokens()) {
                             //assign word to the token
                             word = tokenizer.nextToken();
                             boolean notCommand = true;
                             //perform operation on treestack depending on what word is
                             if (word.equals("printLevelOrder"))  {
                                  System.out.println("printLevelOrder");
                                  theTree.printLevelOrder();
                                  notCommand=false;
                             if (word.equals("printPopLevelOrder"))  {
                                  System.out.println("printPopLevelOrder");
                                  theTree.printPopLevelOrder();
                                  notCommand=false;
                             if (word.equals("printPopInorder"))  {
                                  System.out.println("printPopInorder");
                                  theTree.printPopInorder();
                                  notCommand=false;
                             if (word.equals("printPopPreorder"))  {
                                  System.out.println("printPopPreorder");
                                  theTree.printPopPreorder();
                                  notCommand=false;
                             if (word.equals("printPopRoot"))  {
                                  System.out.println("printPopRoot");
                                  theTree.printPopRoot();
                                  notCommand=false;
                             //if word was not a command it must be a number
                             if (notCommand == true) {
                                  boolean notPlaced = true;
                                  int v = 1;
                                  //starting at the root, find suitable place for number
                                  while ((notPlaced==true) && (v < theTree.size())) {
                                       //if the stack at v is empty, number goes here
                                       if (theTree.element(v).isEmpty()) {
                                            theTree.element(v).push(Integer.valueOf(word));
                                            System.out.println("inserting: "+word);
                                            System.out.println("in empty stack at location: "+(v-1));
                                            notPlaced=false;
                                       //if the stack is not empty
                                       if (notPlaced==true) {
                                            //if the value on the top of the stack is smaller than number, number goes onto the stack
                                            if (  Integer.valueOf(word) > Integer.valueOf( theTree.element(v).top().toString() )  ) {
                                                 theTree.element(v).push(Integer.valueOf(word));
                                                 System.out.println("inserting: "+word);
                                                 System.out.println("in stack at location: "+(v-1));
                                                 notPlaced=false;
                                       //if that node was no good, check the next one for suitability
                                       v++;
              catch (Exception e) {
                   //occurs when user inputs something that is neither a command, or a number, or upon EOF, or stack is full
         public TreeStack () {
              //create the TreeStack ADT by adding stacks in the vector, note vector 0 is instantiated but not used.
              for (int i = 1;i<=TREE_CAPACITY;i++)
                   tree.add(new ArrayStack(STACK_CAPACITY));
         public int size() {
              //return the size of the tree +1 (as 0 is not used)
              return tree.size();
         public ArrayStack element (int v) {
              //return the ArrayStack at v
              return (ArrayStack)tree.get(v);
         public int leftChild (int v ) {
              //return left child of v
              return v*2;
         public int rightChild (int v ) {
              //return the right child of v
              return v*2+1;
         public boolean children (int v ) {
              //search for children of v and return true if one exists
              for (int i =v;i<size();i++) {
                   if (i/2==v ) {
                         //left child found at i
                         return true;
                   if ((i-1)/2==v ) {
                        //right child found at i
                        return true;
              //no children found
              return false;
         public boolean isInternal (int v ) {
              //test whether node v is internal (has children)
              if (children (v)== true) {
                   //has children
                   return true;
              return false;
         //print the top value in each stack encountered on a level-order traversal of tree
         public void printLevelOrder() {
              //for every node of tree v
              for (int v = 1;v<size();v++) {
                   if (!element(v).isEmpty() ) {
                        //print the top value in stack v
                        System.out.println(" "+element(v).top());
                   else {
                        //stack at v is empty
                        System.out.println(" -");
         //pop off and print the top value in each stack encountered on a level-order traversal of tree
         public void printPopLevelOrder () {
              //pop off and print the top value in stack v
              for (int v = 1;v<size();v++) {
              //for each node of tree v
                   if (!element(v).isEmpty() ) {
                        //if v isnt empty print the top value in stack v
                        System.out.println(" "+element(v).top());
                        //pop the top value in the stack at v
                        element(v).pop();
                   else {
                        //stack at v is empty
                        System.out.println(" -");
         //pop off and print the top value in each stack encountered on an in-order traversal of tree
         public void printPopInorder () {
              printPopInorder (1);
         public void printPopInorder (int v) {
              boolean isInternal = false;
              if (isInternal (v)) {
                   //use a boolean for isInternal to save on running the method twice
                   isInternal = true;
                   //recursively search left subtree
                   printPopInorder (leftChild(v));
              //pop off and print the top value at v
              if (element(v).isEmpty() ) {
                   //stack at v is empty
                   System.out.println(" -");
              else {
                   //if v isnt empty print the top value in stack v then pop
                   System.out.println(" "+element(v).top());
                   element(v).pop();
              if (isInternal ) {
                   //recursively search right subtree
                   printPopInorder (rightChild(v));
         //pop off and print the top value in each stack encountered on an pre-order traversal of tree
         public void printPopPreorder() {
              printPopPreorder(1);
         public void printPopPreorder(int v) {
              //pop off and print the top value at v
              if (!element(v).isEmpty() ) {
                   //if v isnt empty print the top value in stack v then pop
                   System.out.println(" "+element(v).top());
                   element(v).pop();
              else {
                   //stack at v is empty
                   System.out.println(" -");
              if (isInternal (v)) {
                   //recursively search left and right subtrees
                   printPopPreorder (leftChild(v));
                   printPopPreorder (rightChild(v));
         //pop off and print all values from the stack at the root
         public void printPopRoot (){
              //while the root stack has values left
              while (!element(1).isEmpty()) {
                   //print, then pop
                   System.out.println(" "+element(1).top());
                   element(1).pop();
    }

  • Query runs from command line, but not from scheduler

    We use Control-M to schedule shell scripts to be run on a Solaris server. Some of the scripts have to access an Oracle database and in that case our security team will include the DB user and password in the script, then encrypt it and the sys admin team schedules the encrypted shell script with Control-M. That works fine, but we've been trying to have the DB user and password on a separate encrypted file so that we don't have to ask for file encryption every time it's necessary to modify a script (this is a test environment).
    We have the script at ~/system_name/scripts, the query at ~/system_name/sql and the encrypted file and key at ~/system_name/keys. The SQLPlus call in the script is:
    ${ORACLE_HOME}/bin/sqlplus "`decrypt -a 3des -k ./../keys/key.3des.system -i ./../keys/login.system`"@instance_name <<EOF
    @${DIR_SQL}/TEST_QUERY.SQL
    quit
    EOF
    The security analyst has tested is successfully from command line, but when we schedule it with Control-M the job abends and we get the following in the sysout:
    + decrypt -a 3des -k ./../keys/key.3des.system -i ./../keys/login.system
    decrypt: cannot open ./../keys/key.3des.system
    decrypt: invalid key.
    + /u00/app/oracle/product/11.1.0/db_1/bin/sqlplus @instance_name
    + 0<<
    @/sistemas/hmp/system_name/sql/TEST_QUERY.SQL
    quit
    SQL*Plus: Release 11.1.0.6.0 - Production on Mon May 3 09:41:55 2010
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    SP2-0310: unable to open file "instance_name.sql"
    Enter user-name: SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER|SYSASM}]
    where <logon> ::= <username>[<password>][@<connect_identifier>] [edition=valu\
    e] | /
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER|SYSASM}]
    where <logon> ::= <username>[<password>][@<connect_identifier>] [edition=valu\
    e] | /
    Enter password:
    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    0000000080
    Any ideas?

    Looks like the command is being split in some way - the connection to sqlplus is being made before it completes the whole string
    It appears to be seeing the @instance_name as a script to execute rather than a db to connect to.
    Is the database on the same server as the script?
    If so, try setting your environment to the correct databsae, so that you can omit the @instance_name part of the syntax and see if it helps
    Also just noticed the failure to open the decrypt script. It would appear uyou are not using a full path name. Have you checked which directroy the scheduled job starts in? You may need to look at running some environment specific scripts first.
    Edited by: LindaA on 05-May-2010 07:43

  • How to run an executable from command-line

    I'm learning how to use the Terminal and I got stuck in a silly thing (I suppose it is). How can I run an executable file from command-line in Terminal?
    For example: I have a file named "Hello" in the folder /sample. If I use the ls command (ls sample), I can see the file Hello. Then I move to the directory (cd /sample) and try to run the file Hello (typing "Hello") but I got "command not found" message.
    If I drag the Hello file from Finder to Terminal and hit Return, it runs perfectly. And if I type the full path to the file (even if I'm already inside its directory), it also runs.
    So, my doubt is if there is any command to run an executable from command-line.
    Thanks

    KJK555 wrote:
    Hi VK:
    Can you enlighten me on why it's neccessary to do the "./" thingy in OS X when in unix/linux
    I never had to resort to doing that?
    Kj
    I took the trouble of reading *man bash* and it explains the issue. to add the current directory to PATH you need to add an empty path to PATH like this
    PATH=$PATH::
    you can add it to ~/.bash_profile so that it's executed automatically when you start bash. I suspect the linux system you are talking about had this set up by default or had it added to PATH in /etc/profile which defines PATH globally.

  • Calling this simple servlet from command line -- ERRORS!

    Below is my servlet. I call from command line via:
    java BatchServlet
    and I get:
    Exception in thread "main" java.lang.NoClassDefFoundError: BatchServlet
    IS there a reason for this
    import java.io.IOException;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class BatchServlet extends HttpServlet implements Runnable{
    static Thread t = null;
    public void init(ServletConfig c) throws ServletException{
    super.init(c);
    if (t==null){
    t = new Thread(this);
    t.start();
    public void run(){
    while (true){
    try{
    Thread.sleep(5000);
    }catch (InterruptedException ie){
    ie.printStackTrace();
    System.out.println("Wake up");

    Same error with this little prog.....
    Notice main method
    package wch.util;
    import java.io.IOException;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class test {
    public void main(){
    System.out.println("test");

Maybe you are looking for

  • How do I update my original 3g iphone?

    How do I update my original 3g iphone? Mac & Itunes are up-to-date, but it's not recognized when I connect.

  • Forms: working and not working. A serendipity question?

    Designed a 4 pp form monthly report. (Extended features in Adobe Reader are already applied) Eight persons will fill it in order to sent to specific clients who only will read it But only two say it works. And told that sometimes the information coul

  • Error in Vendor consignment return PO.

    Dear MM experts, I'm creating a vendor consignment return PO but there's an error message " Return with SD delivery not possible for consignment items". Kindly assist which config that I'm missing out. Regards, DSingh.

  • Can't delete trash

    can't delete trash

  • Comment integrer un bouton photoshop dans un diaporama

    Bonjour, j'aimerais que mon portfolio se comporte de cette façon - visuel de photo en gris - en survol et actif, la photo devient en couleur - quand on clic une fenetre s'ouvre pour la voir en grand en couleur. J'ai donc pris un diaporama, mis les vi