Starting and stopping an RMI server

I'm trying to figure out how to best stop and start my server.
My server class has two executions. One for starting and one for stopping.
Start Steps:
1) create my remote object ( an extension of UnicastRemoteObject )
2) create a registry ( LocateRegistry.create() )
3) bind my remote object
When I run this start method of my RMI server class, everything get's set up. I'm not doing any sort of waiting loop or anything to determine the lifecycle of my server. My understanding is that my rmiregistry, and my registered remote object, will continue to be available indefinitely. Perhaps this is incorrect.
Stop Steps:
When I want to stop the server, I'm calling my stop method. This is another invocation of my server class, so it's a separate JVM. In this stop method I want to do the following steps:
1) get the registry that I created earlier, by port number
2) get my remote object via reg.lookup()
3) unbind my remote obect ( reg.unbind() )
4) unexport my remote object ( UnicastRemoteObject.unexport ( myRemoteObj, true ) )
My concerns here are whether this makes sense. Does the unexport method work like this? i.e. from a remote handle to the object -- I'm not in the local JVM when the stop method runs. Also, does the rmiregistry "just die" at this point? It's not holding anything and when my method exits there's no reference to it anywhere. Except maybe in client code . . .

My understanding is that my rmiregistry, and my registered remote object, will continue to be available indefinitely. Perhaps this is incorrect.That's correct as long as you store static references to them both in the server JVM.
My concerns here are whether this makes sense. Does the unexport method work like this? i.e. from a remote handle to the objectNo. You have to have the actual remote object. You could make shutdown() an RMI method itself.
Also, does the rmiregistry "just die" at this point?No, you have to unexport that as well.

Similar Messages

  • How to start and stop Oracle Application Server from ANT

    How to start and stop Oracle Application Server and Web application from ANT
    Thanks in Advance.
    Mani

    Hi,
    You can use: startManagedWebLogic.sh, it is in your domain directory and you have to execute it in this way
    ./startManagedWebLogic.sh managedServerName http://adminServerHost:adminServerPort
    For instance, in my case I use:
    unixserv01:/webportal/domains/appServerWeb/bin>startManagedWebLogic.sh managedServ01 http://pelma3w3per01.mesaperu.next:7001
    You have to run it on the machine where the managed server was installed.
    Best regards,
    Raúl

  • Start and Stop Weblogic From Admin Console

    Hi All,
    I am using weblogic7.0.I wanted to start and stop the weblogic server from the
    Admin Console(ie., from the GUI).I can stop the server but I cannot start.In order
    to start from admin console what should I do.
    Please post your suggestions.
    Thanks blazix

    You need to run the Node Manager on the manged servers you wish to remotely
    start.
    Chris
    "blazix" <[email protected]> wrote in message
    news:3fc37eea$[email protected]..
    >
    Hi All,
    I am using weblogic7.0.I wanted to start and stop the weblogic server fromthe
    Admin Console(ie., from the GUI).I can stop the server but I cannotstart.In order
    to start from admin console what should I do.
    Please post your suggestions.
    Thanks blazix

  • How to start and stop a server

    I am doing some sockets programming.
    Now, when I want to get the TomCat 4 server running for instance, I would have to run the startup.bat or startup.sh file. To stop the server I run the shutdown.bat or shutdown.sh file.
    Can I do the same thing in Java?
    That is, in one window, I run a program: C:\>java myserver start
    The server starts running and holds there.
    In another window, I run another command: C:\>java myserver stop
    and the server in the other window stops.
    I am thinking the server would be running in a thread. When I shut it down, I close the thread just like in the Applet Clock example.
    I've tried this but it doesn't work.
    Can anyone please advise.
    Thanks.
    Anthony.

    Not precisely that way, but just off the top of my head, you would have to have a handle to the proccess (server) in the first window, then have a monitor program that allows you take this handle and end it. I would make this monitor program be the gateway to starting and stopping your server. To run a .bat file you can use runtime.exec().

  • How to Starting and Stopping OC4J Server using Ant

    How to Starting and Stopping OC4J Server using Ant
    In the ant task definitions for ant-oracle-classes.jar (see antlib.xml) there are two tasks called
         name="restartServer" classname="oracle.ant.taskdefs.deploy.JSR88StartServer"
         name="shutdownServer" classname="oracle.ant.taskdefs.deploy.JSR88ShutdownServer"
    I thought that these would shutdown and start the OC4J server. I guessed the parameters as – (Does anyone know where 50 ant targets are documented?)
    <oracle:restartServer
    userid="${oc4j.admin.user}"
         password="${oc4j.admin.password}"
         deployeruri="${deployer.uri}"
    />
    <oracle:shutdownServer
         userid="${oc4j.admin.user}"
         password="${oc4j.admin.password}"
         deployeruri="${deployer.uri}"
    />
    This, however does not start and stop the SOA suite. To do that I've hacked this solution together -
    <path id="oc4j.console">
         <pathelement location="${oracle.home}/config"/>
         <pathelement location="${oracle.home}/jlib/startupconsole.jar"/>
         <pathelement location="${oracle.home}/opmn/lib/optic.jar"/>
         <pathelement location="${oracle.home}/lib/xmlparserv2.jar"/>
    </path>
    <target name="stop" description="stop oc4j server" depends="init">
         <java classname="oracle.appserver.startupconsole.view.Runner">
              <classpath refid="oc4j.console"/>
              <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
              <arg value="stop"/>
         </java>
    </target>
    <target name="start" description="restart oc4j server" depends="init">
         <java classname="oracle.appserver.startupconsole.view.Runner">
              <classpath refid="oc4j.console"/>
              <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
              <arg value="start"/>
         </java>
    </target>
    This sort of works – except when the SOA suite doesn't stop cleanly – and needs user interaction to press a Close button. This isn't very useful when doing a continous integration build and deploy.
    So, does anyone have any suggestions or alternative methods to do this?
    - frank

    Actually if the server throws exceptions when it stops (which it always has since we applied patch 10.1.3.3) this technique will pause until a user responds to pop-up ... So a better way (I think) is -
    <target name="start" description="start oc4j server" depends="init">
    <java classname="oracle.appserver.startupconsole.view.Runner">
    <classpath refid="oc4j.console"/>
    <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
    <arg value="start"/>
    </java>
    </target>
    <target name="stop" description="stop oc4j server" depends="init">
    <echo message="We expect OC4J *NOT* to stop cleanly, so we will timeout after 3 minutes ..."/>
    <java classname="oracle.appserver.startupconsole.view.Runner" fork="true" timeout="180000">
    <classpath refid="oc4j.console"/>
    <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
    <arg value="stop"/>
    </java>
    </target>
    <target name="restart" description="restart oc4j server">
    <antcall target="stop"/>
    <!-- wait for server to quieten down -->
    <waitfor maxwait="2" maxwaitunit="minute">
    <not><http url="http://${oc4j.http.hostname}:${oc4j.http.port}"/></not>
    </waitfor>
    <antcall target="start"/>
    </target>

  • Sql server agent is not highlighting start and stop options

    I configured snapshot replication , after that sql server agent is not highlighting start and stop options in instance.
    But I can start & stop it in services.msc
    how I can solve this?

    Hi,
    Can you post exact error message.
    Also refer below article, may be similar issue like yours.
    How to start SQL Server Agent when Agent XPs show disabled
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • Starting and Stopping Server from Administration Console without using system ID

    Hi,
    I tried to create another user in the ACL and add it to the Administrators
    group. When I connect to the admin console using this user I receive error
    message NoAccessRuntimeException. Can anybody show me how ti configure user
    to access the console to start and stop managed server. I am using WebLogic
    6.1 SP1. TIA.
    regards,
    Rudy

    Any user added to the Admin group should be able to use the weblogic.Admin
    utility and stop the server and access the console. So if we add Rudy as a user
    to the Admin group then Rudy should be able to stop the server and also use the
    weblogic.Admin commands. however, you cannot start the server with rudy's
    password. You will require a system password for starting the server.
    Please check if the user has been added correctly to the Admin group. you can
    check this in the fileRealm.properties file:
    user.rudy=0x751cc5f18261ba5e570c19a0d2d3cc29a5c5de63
    group.Administrators=system,rudy
    hope this helps,
    Mihir
    Rudy Sutjiato wrote:
    Hi,
    I tried to create another user in the ACL and add it to the Administrators
    group. When I connect to the admin console using this user I receive error
    message NoAccessRuntimeException. Can anybody show me how ti configure user
    to access the console to start and stop managed server. I am using WebLogic
    6.1 SP1. TIA.
    regards,
    Rudy

  • I am getting a service start and stop alert while doing the windows server updates.

    HI
    I am getting a service start and stop alert while doing the windows server updates. Services are wmiApSrv , WPDBusEnum. Can you please help me to under stand why i am getting the service start and stop alert.
    Thanks & Regards
    Abhilash K Joy

    Hi,
    The WMI Performance Adapter (wmiApSrv) service provides performance library information from Windows Management Instrumentation (WMI) providers to clients on the network. This service only runs when Performance Data Helper is activated.
    This service is installed by default and its startup type is Manual. When started in the default configuration it will log on using the Local System account.
    You can try troubleshooting the issue using Clean Boot to check if the issue is related to third-party software.
    How to perform a clean boot in Windows
    http://support.microsoft.com/kb/929135/en-us
    Best Regards,
    Mandy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • How to create services start and stop automation script for diff servers

    Hi All,
    i want to create a bat file for automation purpose to start and stop services
    i have some services in 1st server aand some in 2nd server and some in 3rd servers.
    has you all know i have to follow sequences to start and stop services can any help me in creating .bat by linking 3 servers fo starting and stoping services.
    Thanks in advance
    Regards
    SM

    Hi,
    this is the list of start oder for services in 11.1.2.1 from the Installation and Configuration Guide
    1. Databases for repositories.
    2. Any corporate user directories that you plan to configure for use with Shared Services.
    3. Foundation Services Managed Server application server, which includes Shared Services,
    and EPM Workspace.
    4. Reporting and Analysis Framework — Agent Service (if required for your environment)
    5. Reporting and Analysis Framework Application Server (if required for your environment)
    6. Web server
    The remaining services and processes can be started in any order:
    1. Performance Management Architect Services
    2. Performance Management Architect application server
    3. Performance Management Architect Data Synchronizer application server
    4. Essbase Server
    5. Administration Services application server
    284 Starting and Stopping EPM System Products
    6. Integration Services Server
    7. Essbase Studio Server
    8. Provider Services application server
    9. Financial Reporting Services
    10. Financial Reporting application server
    11. Web Analysis application server
    12. Calculation Manager application server
    13. Planning application server and the Hyperion RMI Registry
    14. Financial Management service
    15. Financial Management Web application server
    16. Strategic Finance service
    17. Performance Scorecard application server
    18. Performance Scorecard Alerter application server
    19. Profitability and Cost Management application server
    to start services on different servers you can use the sc command in your batch file
    for eg
    sc \\10.121.201.21 start HypS9FrameworkAgent

  • Batch file to start and stop

    Hi All,
    Can we create a batch file to start and stop the services. I need to start all the services like shared, essbase, eas, planning, webanlysis and financial reporting, and at also need to stop them using windows batch file.(Using windows 2003 server....service pack 1). Any help would be appreciated.
    Thanks

    Hi,
    The simplest script would be something like this. Save it as a .bat file, set all your services to manual and then set up a scheduled task to run this script when the computer starts.
    Gee
    ::          Startup Script for Hyperion Services          ::
    date/t >> startup.log
    time/t >> startup.log
    echo "Starting Hyperion Services" >> startup.log
    net start "Hyperion S9 OpenLDAP" >> startup.log
    net start "Hyperion S9 Shared Services" >> startup.log
    :: Insert pause of 5 seconds to ensure HSS has finished starting
    ping localhost -n 6 >nul
    net start "Hyperion S9 BI+ Analytic Services 9.3.1 - Essbase" >> startup.log
    net start "Hyperion S9 Administration Services ATS5" >> startup.log
    net start "HyperionRMIRegistry" >> startup.log
    net start "Hyperion S9 Planning" >> startup.log
    net start "Hyperion S9 Provider Services ATS5" >> startup.log
    net start "Hyperion S9 Apache 2.0" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Core Services 1" >> startup.log
    :: Insert pause of 10 seconds to ensure Core has finished starting
    ping localhost -n 11 >nul
    net start "Hyperion S9 BI+ 9.3 Workspace" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Financial Reporting Java RMI Registry" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Financial Reporting Print Server" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Financial Reporting Report Server" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Financial Reporting Scheduler Server" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Financial Reporting Web application" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Web Analysis" >> startup.log
    date/t >> startup.log
    time/t >> startup.log
    echo "Finished Starting Hyperion Services" >> startup.log
    echo "###################################################################" >> startup.log

  • Stop Java RMI server properly

    Hi all,
    Currently, I implemented database application with RMI. But I have a problem about shutting down RMI server properly. Here are my method to start and stop RMI server
        public static void initRMI() {
            try {
                registry = LocateRegistry.createRegistry(Config.PORT);
                driverImp = new RemoteDriverImpl();
                driver = (RemoteDriver) UnicastRemoteObject.exportObject(driverImp, Config.PORT);
                registry.rebind("simpledb", driver);
                System.out.println("putting RMI driver");
            } catch (Exception ex) {
                Logger.getLogger(SimpleDB.class.getName()).log(Level.SEVERE, null, ex);
    public static void stop() {
            try {
                System.out.println("Remove rmi entry");
                registry.unbind("simpledb");
                UnicastRemoteObject.unexportObject(driverImp, true);
                System.gc();
            } catch (Exception ex) {
                Logger.getLogger(SimpleDB.class.getName()).log(Level.SEVERE, null, ex);
    }When I start server and there is no request from client, the stop() method is working correctly, i.e. the RMI server, as well as, its JVM are terminated.
    But there are some requests from client before, the stop() method only remove stub object from rmiregistry, but doesn't stop its JVM. And I don't want to use System.exit(0) to shut down since the program will continue running other stuffs.
    I hope that I explain the situation clearly.
    Thank you
    Edited by: Apolozeus on Jan 18, 2010 4:05 AM

    Hi all,
    Currently, I implemented database application with RMI. But I have a problem about shutting down RMI server properly. Here are my method to start and stop RMI server
        public static void initRMI() {
            try {
                registry = LocateRegistry.createRegistry(Config.PORT);
                driverImp = new RemoteDriverImpl();
                driver = (RemoteDriver) UnicastRemoteObject.exportObject(driverImp, Config.PORT);
                registry.rebind("simpledb", driver);
                System.out.println("putting RMI driver");
            } catch (Exception ex) {
                Logger.getLogger(SimpleDB.class.getName()).log(Level.SEVERE, null, ex);
    public static void stop() {
            try {
                System.out.println("Remove rmi entry");
                registry.unbind("simpledb");
                UnicastRemoteObject.unexportObject(driverImp, true);
                System.gc();
            } catch (Exception ex) {
                Logger.getLogger(SimpleDB.class.getName()).log(Level.SEVERE, null, ex);
    }When I start server and there is no request from client, the stop() method is working correctly, i.e. the RMI server, as well as, its JVM are terminated.
    But there are some requests from client before, the stop() method only remove stub object from rmiregistry, but doesn't stop its JVM. And I don't want to use System.exit(0) to shut down since the program will continue running other stuffs.
    I hope that I explain the situation clearly.
    Thank you
    Edited by: Apolozeus on Jan 18, 2010 4:05 AM

  • How to create a .exe script to start and stop Oracle EBS R12 in Linux

    Hello,
    I have installed Oracle EBS R12 in Linux enterprise through Virtual box on windows 7 professional. It takes a long time to start and stop EBS as I have to start and stop the scripts manually - can someone please help me with the following (I have tried searching the web and Oracle for help but have had no joy);
    Q1. I want to create a executable file in Linux so I can double click the file in Linux to start EBS automatically instead of going through each script manually
    Q2. I want to create a executable file in Linux so I can double click the file in Linux to stop EBS automatically instead of going through each script manually
    you help will be appreciated.
    Ali

    I have installed Oracle EBS R12 in Linux enterprise through Virtual box on windows 7 professional. It takes a long time to start and stop EBS as I have to start and stop the scripts manually - can someone please help me with the following (I have tried searching the web and Oracle for help but have had no joy);
    Q1. I want to create a executable file in Linux so I can double click the file in Linux to start EBS automatically instead of going through each script manually
    Q2. I want to create a executable file in Linux so I can double click the file in Linux to stop EBS automatically instead of going through each script manually
    you help will be appreciated.Please see these links.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Autostart+AND+Services&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Auto+AND+Start+AND+Services&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Managing Server Processes
    http://docs.oracle.com/cd/E18727_01/doc.121/e13675/T530130T530133.htm#5274555
    Thanks,
    Hussein

  • Batch file to start and stop services

    I've setup a CF Probe on my Development Server to ensure my
    CF Production server is up and running (services = Apache and CF
    Application Server). It checks the PROD login page and if it times
    out in 30 sec the probe fails. I understand I can execute a file
    (batch file with net start and net stop) but the problem is I need
    to have the probe somehow point to the .bat file on the PROD server
    and not on the local machine. How can I remotely access this batch
    file and execute it? I don't know how to point to the file on the
    other server... can anyone help?

    Hi Ken,
    You had pointed me in the right direction regarding the
    psstools in order to create a batch file that can remotely start
    and stop services.
    i used the psexec command and am able to successfully restart
    the services needed remotely... however when i pick the file in the
    coldfusion administrator (in the probes section) how to i point to
    the batch file to run? it seems like the probe is not running the
    script like i want... the file is located on the c:\ so i entered
    c:\test2.bat...
    Thanks,
    Matt
    Matt,
    You should review the online help in the cfadmin for probes
    and the links it points you to in the developer's guide. Basically
    you need to define a new probe in the cfadmin by clicking the
    "Define New Probe" button. One of the probe's attributes will be
    what action. Define the action as a program and point it at a batch
    file running psexec. You will probably need to run CFMX as a
    specific user and not as localsystem, which is the default.

  • How to Start and Stop Processes?

    How to Start and Stop Processes?
    Im trying to create a program which allows me to Start and Stop (and Restart) GameServers. I will then expand on this so i can start and stop them through a web applet with build in useraccounts.
    Currently the way we do this is to log into the server using a RemoteAssistance. Which is not very safe as the users have the abbility to do anything on the server and potentially corrupt it.
    Below is my code for how i start the servers. But i dont know how i would stop the process.
                    private void startServers()
                   for(GameServer gs : servers)
                        int ID = Integer.parseInt(gs.getID());
                        if(isChecked(ID))
                             try
                                  String cmd[] = gs.getStartString();
                                  Runtime.getRuntime().exec(cmd);
                                  int sleepPeriod = Integer.parseInt(sleepField.getText());
                                  Thread.sleep(sleepPeriod*100);     
                             catch(Exception e)
                             System.out.println(e);
                   }//end of iterator
                   JOptionPane.showMessageDialog(null,"All Selected Servers Have been started.","Servers Started",2);     
         }//end of startserversAnyhelp would be great thanks.

    Using the process class would give you a nicer API, but using destroy isn't a nice way to shutdown a process. Its like killing the process with your task manager. You should make a connection in some way with the game server and tell it to shutdown in stead (gracefull termination).

  • How to start and stop a progress-bar thread before/after the main thread

    hi. I would appreciate any kind of help on my request.
    I have this as my main() function
         public static void main(String[] args)
              SwingUtilities.invokeLater(new Runnable(){
                   public void run(){                              
                        Options op = new Options();
                        OdessaClient oc = new OdessaClient(op);     
                        oc.setVisible(true);                    
         }Whenever I try to start a simple JFrame with an indeterminate progress bar on it just before the main function and stop it somewhere after I get a StackOverFlow error
    Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
         at java.awt.Component.show(Component.java:1302)
         at java.awt.Component.setVisible(Component.java:1253)
         at com.client.CylonBar.hide(CylonBar.java:25)
         at java.awt.Component.show(Component.java:1302)
         at java.awt.Component.setVisible(Component.java:1253)
    ...and so on...How must I implement something like it?

    Not precisely that way, but just off the top of my head, you would have to have a handle to the proccess (server) in the first window, then have a monitor program that allows you take this handle and end it. I would make this monitor program be the gateway to starting and stopping your server. To run a .bat file you can use runtime.exec().

Maybe you are looking for

  • How to calculate the unit for RATE?

    Hey All, I am not sure if there is something standard for this or not. I am calculating the 'Rate' by using 'Value/Amount' and 'Quantity' as follows - Rate == Value /  Quantity I need to calculate the unit for the rate as below - Rate unit == Value u

  • I can't open itunes, HELP!

    my itunes will not open please help me

  • After Schedule , Blank Report

    Hello Everybody , I add a variable to report , After scheduling the report , content,datas of the report are empty.But If I remove variable , after schedule , the report datas and contents are normal appearing.In both cases the report save to my comp

  • How to reduce size of popupbox when using function module  POPUP_TO_CONFIRM

    hi all, i have one doubt. when i use POPUP_TO_CONFIRM function module it is showing the message in a popup. this popupbox size is constant. now i want to change the size of the window. is there any function module exist. i refered old threads but i u

  • Embedded Spreadsheet can't be viewed

    After downloading the service patch for Xcelsius 2008, I have a blank window where the embedded spreadsheet is supposed to be (literally I can see right through to whatever is open on my screen behind Xcelsius).  Anybody know what is wrong? Thanks, S