How to stop rmiregistry through java coding?

Hi,
I don't know how to write java program to stop rmiregistry running on port 1099 ?
Could anyone please help me?
If possible please tell me the logic behind server shutdown program, like what we have in tomcat server, jboss etc.,
Thanks and Regards
Ram

hi,
Consider I'm working in the same JVM, I started rmiregistry using the command "LocateRegistry.createRegistry()". With respect to this scenario, please tell me how to stop the rmiregistry (say running on the port 1099)?
Thanks and Regards,
Ram

Similar Messages

  • How to 'STOP' a running java thread in J2ME?

    Dear All,
    How to 'STOP' a running java thread in J2ME?
    In the middleware viewpoint, for some reasons we have to stopped/destroyed the running threads (we have no information how these applications designed).
    But in J2ME, Thread.destroy() is not implemented. Are there other approaches to solve this problem?
    Thanks in advance!
    Jason

    Hi jason,
    Actually there are no methods like stop() and interrupt() to stop the threads in J2ME which is present in normally J2SE Environment.
    But the interrupt method is introduced in Version 1.1 of the CLDC.
    So, we can handle the thread in two ways.
    a) If it is of single thread, then we can use a boolean variable in the run method to hadle it. so when the particular boolean value is changed , it will come out of the thread.
    for eg:
    public class exampleThread implements Runnable
    public boolean exit = false;
    public void run()
    while(!exit)
    #perform task(coding whatever u needed)
    public void exit()
    exit = true;
    b) If it is of many threads then we can handle using the instance of the current thread using currentThread() method
    for eg:
    public class exampleThread implements Runnable
    public Thread latest = null;
    public Thread restart()
    latest = new Thread(this);
    latest.start();
    public void run()
    Thread thisThread = Thread.currentThread();
    while( latest == thisThread )
    #perform some tasks(coding part);
    public voi d stopAll()
    latest = null;
    while ( latest == thisThread )
    performOperation1();
    if( latest != thisThread )
    break;
    performOperation2();
    Regards,
    Prathesh Santh.

  • How to send sms through java program?

    hi,
    i am trying to send sms through java program.i am usining ubuntu 6.04.i am using modem MC35i.i use the jSMSEnjine.jar and rxtxcomm.jar.
    these are the following program.
    import org.jsmsengine.*;
    import java.util.*;
    class SendMessage
         public static void main(String[] args)
              int status;
              // Create jSMSEngine service.
         CService srv = new CService("Com2",9600);
              //CService srv = new CService("COM2",9600);
              System.out.println();
              System.out.println("SendMessage(): sample application.");
              System.out.println(" Using " + srv._name + " " + srv._version);
              System.out.println();
              try
                   //     Initialize service.     
                   srv.initialize();
                   Thread thread =Thread.currentThread();
                   thread.sleep(1000);
                   System.out.println(srv);
                   //     Set the cache directory.
                   srv.setCacheDir(".\\");
                   //     Set the phonebook.
                   //     srv.setPhoneBook("../misc/phonebook.xml");
                   //     Connect to GSM device.
                   status = srv.connect();
                   //     Did we connect ok?
                   int st=CService.ERR_OK;
                   System.out.println(st);
                   System.out.println(status);
                   if (status == CService.ERR_OK)
                        //     Set the operation mode to PDU - default is ASCII.
                        srv.setOperationMode(CService.MODE_PDU);
                        // Set the SMSC number (set to default).
                        srv.setSmscNumber("");
                        //     Print out GSM device info...
                        System.out.println("Mobile Device Information: ");
                        System.out.println("     Manufacturer : " + srv.getDeviceInfo().getManufacturer());
                        System.out.println("     Model : " + srv.getDeviceInfo().getModel());
                        System.out.println("     Serial No : " + srv.getDeviceInfo().getSerialNo());
                        System.out.println("     IMSI : " + srv.getDeviceInfo().getImsi());
                        System.out.println("     S/W Version : " + srv.getDeviceInfo().getSwVersion());
                        System.out.println("     Battery Level : " + srv.getDeviceInfo().getBatteryLevel() + "%");
                        System.out.println("     Signal Level : " + srv.getDeviceInfo().getSignalLevel() + "%");
                        //     Create a COutgoingMessage object and dispatch it.
                        //     *** Please update the phone number with one of your choice ***
    // String smsLengthTest="Hi"+"\nTesting is going on.Test for sending unlimited number of charecter.So you will get N number of SMS.Initially I trancate the whole string by 70 charecter.Later I will put it upto 90 charecter.Some chararecter should kept for header portion.I don't know the total number.It is just test.If you got the sms u should appreciate me...This is Ripon...I have written sms program";
    String smsLengthTest="Hi\n"+"This is Govindo";
    int mao=smsLengthTest.length();
    System.out.println("Length of sms :"+mao);
    String smsNo="9433314095";
    smsNo="+91"+smsNo;
    if(mao<70)
    COutgoingMessage msg = new COutgoingMessage(smsNo,smsLengthTest);
    //     Character set is 7bit by default - lets make it UNICODE :)
    //     We can do this, because we are in PDU mode (look at line 63). When in ASCII mode,
    //          this does not make ANY difference...
    msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_UNICODE);
    if (srv.sendMessage(msg) == CService.ERR_OK) System.out.println("Message Sent!");
    else System.out.println("Message Failed!");
    else
    // COutgoingMessage msg = new COutgoingMessage(smsNo,smsLengthTest);
    // LinkedList messageList;
    // messageList = new LinkedList();
    // messageList.add(msg);
    // LinkedList maooo=new LinkedList();
    // maooo=srv.splitLargeMessages(messageList);
    int sizelength=0;
    int counter=0;
    sizelength=smsLengthTest.length();
    System.out.println("SMS length :"+sizelength);
    int smsCntr=sizelength/70;
    System.out.println("smsCntr :"+smsCntr);
    counter=smsCntr+1;
    int j=70;
    int k=0;
    try
    for(int i=0;i<smsCntr;i++)
    String test="";
    test=test+i;
    test=smsLengthTest.substring(k,j);
    System.out.println(test);
    System.out.println(test.length());
    COutgoingMessage msg = new COutgoingMessage(smsNo, test);
    System.out.println("hi this is suman" + smsNo);
    //     Character set is 7bit by default - lets make it UNICODE :)
    //     We can do this, because we are in PDU mode (look at line 63). When in ASCII mode,
    //          this does not make ANY difference...
    msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_UNICODE);
    if (srv.sendMessage(msg) == CService.ERR_OK) System.out.println("Message Sent!");
    else System.out.println("Message Failed!");
    k=k+70;
    j=j+70;
    catch(Exception e)
    System.out.println("Error...1");
    e.printStackTrace();
    e.getMessage();
    String lastPortion=smsLengthTest.substring(k);
    System.out.println(lastPortion);
    COutgoingMessage msg = new COutgoingMessage(smsNo, lastPortion);
    //     Character set is 7bit by default - lets make it UNICODE :)
    //     We can do this, because we are in PDU mode (look at line 63). When in ASCII mode,
    //          this does not make ANY difference...
    msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_UNICODE);
    if (srv.sendMessage(msg) == CService.ERR_OK) System.out.println("Message Sent!");
    else System.out.println("Message Failed!");
                        // Disconnect from GSM device.
                        srv.disconnect();
                   else System.out.println("Connection to mobile failed, error: " + status);
              catch (Exception e)
                   e.printStackTrace();
              System.exit(0);
    the error is:
    SendMessage(): sample application.
    Using jSMSEngine API 1.2.6 (B1)
    org.jsmsengine.CService@addbf1
    0
    -101
    Connection to mobile failed, error: -101
    please help me,its very urgent.

    come back in about 5 years, we may have time for you by then.
    In the meantime, how about contacting the people who wrote that library and asking them nicely for help (rather than trying to order people to drop whatever they're doing and jump through hoops to accommodate your every wish as you're doing here)?

  • How to execute vbscript through java

    hi i m trying to run vbscript (that accept some command line arguments) through java .
    my vbs file is stored in c: drive
    purpose of vbs file : to map network drives.
    i normally run it from command prompt using following syntax
    c:\cscript map.vbs l: \\10.22.122.35\d$ <username> <password>
    code in map.vbs
    map.vbs
    Dim objNetwork
    Set objNetwork = WScript.CreateObject("WScript.Network")
    strLocalDrive = WScript.Arguments.Item(0)
    strRemoteShare = WScript.Arguments.Item(1)
    strPer = "FALSE"
    strUsr = WScript.Arguments.Item(2)
    strPas = WScript.Arguments.Item(3)
    objNetwork.MapNetworkDrive strLocalDrive, strRemoteShare, strPer, strUsr, strPas
    my problem is i can easily accomplish this by using .batch file but i dont want to reveal my username and password
    i just want to know is there any way thru which i can somehow link java program with dos command and execute vbs file
    from my java program.
    the code that i have got is not working properly or has to be modified to work.
              String os = System.getProperty("os.name").toLowerCase();
         if (os.indexOf("windows") != -1)
              String[] command = new String[]{"cmd.exe", "/c","cscript","c:\\map.vbs", '"'+strDrive+'"','"'+strPath+'"',"<username>" ,"<password>"};
              Runtime.getRuntime().exec(command);
    Kindly help me as this is very urgent.

    prompt for the login, the password, and the new share name, and store them in variables, then, you can do something like:
    Runtime.getRuntime().exec("net use " + sharenameVar + " \\\\HOST\\share /user:HOST\\" + userVar + " \"" + passwordVar + "\"");with the following values:
    HOST: PC10
    user : toto
    pass : a password
    sharename: I:
    it will result in :
    net use I: \\PC10\share /user:PC10\toto "a password"
    this will map the new share with the given credentials ; there is no need to add some complexity by using a vbscript to do that

  • How to Invoke BPEL through JAVA

    I am struggling since last 4-5 days to invoke BPEL process through java.
    So can any one provide me with full code.
    I want any java code like jsp,core java,servlets etc.
    Here is my jsp code with which I am trying to invoke my BPEL process named 'invoke'.which has just one input parameter 'InvokeProcessRequest'.
    The error is 500 internal server error.
    also,
    I want to know,
    what parameter to write in Locator class.
    whether we have to make in changes in any xml file or so.
    <%@page import="com.oracle.bpel.client.Locator" %>
    <%@page import="com.oracle.bpel.client.NormalizedMessage" %>
    <%@page import="com.oracle.bpel.client.dispatch.IDeliveryService" %>
    <html>
      <head>
       <title>InvokeBPEL</title>
      </head>
    <body>
    <%
      String Payload = request.getParameter("Payload");
    %>
        <!-- Construct HTML form here -->
         <h3>Invoke</h3>
    <h4>Application Form</h4>
    <form>
       <table>
       <tr>
         <td>Payload</td>
         <td><input type="text" name="Payload" value="123456789"></td>
       </tr>
       <tr>
         <td>InvokeProcessRequest</td>
         <td><input type="text" name="InvokeProcessRequest" value="invoke"></td>
       </tr>
       </table>
       <input type="submit" value="Send Application">
    </form>
    <%
        // 1. Get form fields
         String InvokeProcessRequest = request.getParameter("InvokeProcessRequest"); 
        // 2. Create loan application XML document
          String xml = "<invoke xmlns=\"http://www.w3.org/2001/XMLSchema\">"      
             + "<Payload>" + Payload + "</Payload>"     
          + "<InvokeProcessRequest>" + InvokeProcessRequest + "</InvokeProcessRequest>"     
            + "</invoke>";
        // 3. Initiate the BPEL process here
          // Connect to Oracle BPEL server
             Locator locator = new Locator("default","bpel");
            IDeliveryService deliveryService = (IDeliveryService)
            locator.lookupService(IDeliveryService.SERVICE_NAME );
             // Construct a normalized message and send to Oracle BPEL Process Manager  
         NormalizedMessage nm = new NormalizedMessage();  
         nm.addPart("payload", xml);
           // Initiate the BPEL process  
         deliveryService.post("invoke", "initiate", nm);
         %>    <p>BPEL Process <code>MyLoanFlow</code> initiated    
                 with a loan application containing Payload=<%= Payload %></p>
               <p>Please refer to the   
               <a href="/BPELConsole/displayInstance.jsp">BPEL Console</a>
                to see the status of the initiated MyLoanFlow BPEL Process.</p>
         <%
    %>
    </body>
    </html>

    Krishna, Not sure what you mean by 'normal' web service....I mean, is BPEL service not normal, is it not as per WS standards. It would be interesting if you could shed some light on that.
    On the question of calling BPEL, I thought there were two methods - one is using the BPEL PM API, which uses the locator class to get hold of BPEL PM instance and then call a deployed bpel service
    The other way is to develop a web service proxy using JDeveloper. Its a very simple process. Once you do that, you can call the proxy from Java.

  • How to read a Excel file through java coding

    Hi,
    *I need to have a code with reads data from excel file. Could u forward the jar files needed for that also.
    *presently we are using client systems so we are not able to get the following jar files. Please sent these jar files inorder to proceed me to write module processor or for writing java proxies.
    • aii_af_cci.jar
    • aii_af_mp.jar
    • aii_af_ms_api.jar
    • aii_af_ms_spi.jar
    • aii_af_trace.jar
    • aii_af_svc.jar
    • aii_af_cpa.jar
    Thank u

    Hi Shaker thank u ,
    but plz forward the jar file needed to read that is "jxl.jar" and the other jar files defined in earlier  message, to my mail id .
    just for confiramtion i defined again here:
    • aii_af_cci.jar
    • aii_af_mp.jar
    • aii_af_ms_api.jar
    • aii_af_ms_spi.jar
    • aii_af_trace.jar
    • aii_af_svc.jar
    • aii_af_cpa.jar
    jxl.jar
    Thank u

  • How to create trigger through Java programm?

    I write a Java programm to create a trigger(through JDBC connection). After I run the programm, a trigger was created in Oracle 10g.But the trigger is invalid. After Compiling the trigger , a error "PLS-00103 " occured .But if I excute the SQL in SQL developer,the trigger was created successfully.
    If there is some special considerations should be taken when using programm to create trigger?
    My Java programm fragment as follows:
         public void createTrigger() throws SQLException{
              Statement stmt = conn.createStatement();
              stmt.executeUpdate(getCreateTriggerSql());
    Edited by: jerry on 2010-6-29 下午6:42

    Yes the special consideration is you shouldn't perform DDL on the fly, as it has all kinds of unwanted side effects like implicit commits.
    If I would start a company, and I discover one of my developers is writing this kind of program, I would fire him, on the spot.
    Sybrand Bakker
    Senior Oracle DBA

  • How to stop a daemon Java Thread?

    If I have a thread set as daemon and the main program has already exited, how do I locate the thread to stop it?
    Thanks.

    > As for stopping it you use a socket and send it a message. That of course would require another thread because it is a listener.
    Could you explain me a little bit more this (or send a link)? That is probably what I want to do. I want to open another instance of the program and stop the running thread. (By the way I'm doing this on Windows).
    Daemon thread != unix daemon.
    I'm not actually setting the thread as deamon because I want it as a background task, but because I want the main program to exit after it has started the thread and I want the thread to keep running. I read somewhere that I could do this setting the thread as daemon. But I misunderstood what I read.
    Again, what I want to know if there's a way of running an app that when you press a start button, for example starts a thread that performs some ops. and exits, but the thread is still running, and if you re-open the app and press the stop button it stops the running thread, that is, the instance of the app that created the thread is not the one who's going to stop it.
    I don't necesarily want to do it using threads but that was the way I first thought of.
    Thank you for your reply :)
    Message was edited by:
    daraii

  • How to send mail through java program in solaris server

    hi
    i am writing java code to send the mail using my company SMTP
    ,the program is working fine when i run and deploy in windows environment
    but at the same time when i deploy the war to sun solaris server ,it is not working
    and throwing the Error saying
    java.lang.Exception: Invalid Addresses; nested exception is:      javax.mail.SendFailedException: 553 sorry, that domain isn't allowed to be relayed thru this MTA without authentication #5.7.1     at jsp.SendMail._jspService(_SendMail.java:137)
    i am using the Authentication also using user id and password of same domain and it is able to authenticate
    in windows but not in Solaris
    where i am making mistake plz
    guide.
    Saurabh

    thanks Alan
    but i think there is some other problem because same code is
    working when i am using in windows as well as i am using authentication method
    also but it is not working when running in Solaris Environment
    here is the code i am using to send the mail
    props.setProperty("mail.transport.protocol", "smtp");
    props.setProperty("mail.host", "smtp.mycompany.com");//smtp protocol for IIBF
    props.put("mail.smtp.starttls.enable","true");//setting start TLS to be true
    props.put("mail.smtp.auth", "true");// authentication is false
    props.put("mail.smtp.port", port);//setting the port number it can be either 25 or 587
    props.put("mail.smtp.username", "noreply");
    props.put("mail.smtp.password","noreply");
    props.put("mail.debug", "true");
    Authenticator auth = new SMTPAuthenticator();
    Session session1 = Session.getDefaultInstance(props);
    java.util.Properties sessionProperties = new java.util.Properties();
    sessionProperties.put("mail.smtp.auth", "true");
    message.setFrom(new javax.mail.internet.InternetAddress(From ,"name"));
    message.addRecipient(javax.mail.Message.RecipientType.TO, new javax.mail.internet.InternetAddress(To));
    message.setText(TextCo);
    message.setSubject(subject);
    message.setContent(boyd, "text/plain");
    message.reply(true);
    Transport trans = session1.getTransport("smtp");
    trans.connect(SMTP_HOST_NAME, SMTP_AUTH_USER, SMTP_AUTH_PWD);
    boolean ddd = trans.isConnected();
    message.saveChanges();
    trans.sendMessage(message, message.getAllRecipients());
    above code is working properly in windows but not in Solaris
    plz guide what next to do
    thankx in advance
    saurabh

  • How to send images through java or RMI.?

    Hello,
    I have a problem with RMI. I had created a canvas on which you can draw anything then when clicking send button this drawing should be reach to another client(s). so please guide me how to do it. and also please give some code if possible.
    thanks very much.
    umesh m joshi

    Hello RoopaSri:
    Umm, I don't think it will help in his case. He means to send a drawing from a canvas and not a image file.So that is back to his question
    hello umjosh ,
    you can get an image object from the Graphics class and RMI the bytes gotten from the image object. U can find in this forum on how to save the canvas. instead of saving, u can send the bytes.
    eg Imageicon imgIcon=new Imageicon("imagefile.jpg");
    and send it to the remote object. Use
    ImageIcon.getImage can used to exrtract the image.
    Hope this helped.
    Regards,
    Roopa Vittal
    developer technical Support
    SUN Microsystems.

  • How to stop single VU, java-code

    Hi,
    Is there a way to stop a single VU?
    E.g:
    if (condition){
    stop iterating;
    Regards

    public void run() throws Exception
        boolean stopIt = false;          
        if (stopIt)
            IteratingVUser vu = (IteratingVUser) this.getScriptVUser();
            vu.stop();
            return;
    }

  • How to build scheduler through java

    Dear Member,
    I have one requirement where we have to retrieve the records from database at schedule time (e.g. every monday 3.00 PM) . Is there any way in java that will invoke perticular event at schedule time.
    Regards

    which suggests you have a scheduling system already, which should be able to launch tasks, which could be Java programs...
    Yes, you can do things like that in Java (or any general purpose programming language), but most likely in this case you don't want to and should rather leverage capabilities already available in the organisation.

  • How to hide Frames through Java script in FireFox.

    Hi,
    I am working on CRM ISA B2B application and hiding some frame in B2B through javascript. It is working fine in IE but it is not working at all in Firefox.
    Below is the example of hiding frame which I am using. it is working fine in IE but not working at all in FireFox. There are total 3 files (1) main.html (2)blank1.html (3)blank.html.
    1) main.html ( this is the main HTML)
    ===========
    <html>
    <head>
    <title> Testing </title>
    </head>
    <frameset id="TopFrame" rows="80,*">
         <frame src="blank.html" name="top">
         <frameset id="middle" cols="160,*">
              <frame src="blank1.html" name="side">
              <frame src="blank.html" name="main">
         </frameset>
    </frameset>
    </html>
    ===============
    2) blank1.html
    ===============
    <html><head>
    <script language="javascript">
    function hideframe()
    parent.document.all("TopFrame").all("middle").cols="100%,*";
    function showframe()
         parent.document.all("TopFrame").all("middle").cols="50%,50%";
    </script>
    <title>Blank Title</title>
    </head>
    <body>
    <h1>Blank1</h1>
    <input type="button" value="test" onClick="hideframe();">
    <input type="button" value="Show" onClick="showframe();">
    </body>
    </html>
    =============
    3) blank.html
    ============
    <html><head>
    <script language="javascript">
    function hideframe()
         parent.document.all("TopFrame").all("middle").cols="100%,*";
    function showframe()
         parent.document.all("TopFrame").all("middle").cols="50%,50%";
    </script>
    <title>Blank Title</title>
    </head>
    <body>
    <h1>Blank 0</h1>
    <input type="button" value="test" onClick="hideframe();">
    </body>
    </html>
    ==============
    Above code is working fine in IE but not working at all in FireFox.
    Any help would be highly appreciated.
    Pl. help me out.
    Thanks.
    Ashish Patel.

    Hello,
    Press F11 to go into full screen mode (Mac: Command+Shift+F).
    If you're on Windows, right-click an empty area of the tab bar and choose Customize. Click the Title Bar button in the lower left corner to toggle it. Click the Exit Customize button when done.
    If you're on Linux, your window manager may allow you to hide the title bar and window frame. For example, KDE has a "No titlebar and frame" setting.
    * http://userbase.kde.org/KWin_Rules_Window_Attributes

  • How to activate a specific profile of the Firefox using java coding?

    Hi Folks,
    I have some query regarding activating the Profiles of the Firefox. Whenever i open the Firefox, the profile manager will be prompting for the profile to be activated. I want to perform such similar operation through java coding. Let us assume, I have three profiles named default, office and personal. I need to invoke the Firefox with a specific profile, office. How to proceed further? Your suggestion will be highly appreciated...
    Thanks in Advance,
    RealStuff, Mike

    String s = "Less than 20";
    while(s.length() < 20) {
         s += " ";
    System.out.println(s + " " + s.length());Mark

  • Hot to call  forms11g  fmx file  through Java executable

    Hi,
    Iam having one file in some folder which will come through FTP , whenever file comes to the folder i should call the some form fmx file through JAVA so that my form will take care rest of the things .
    My question is how to call fmx through Java executable in windows environment.
    thanks in advance
    GV

    Hi All,
    Thnaks for the Info. But my requirement is different.
    1) whenever i received a file through FTP from other server to my server , some folder say d:\Test
    a) some batch program has to trigger and first it should take the backup of the received file to some other folder say d:\archive
    b) some batch program has to trigger to call the forms fmx file so that form will take care of reading from the file and put the data to database for the received file in d:\Test.
    Assume that it is in windows environment/Linux Environment . How i can achieve these tasks. There should not any user intervention in this , everything is automatic.
    Please guide me any solutions
    Thanks in advance
    GV

Maybe you are looking for

  • HP Officejet Pro L7590 and Mac Yosemite 10.10 printing software

    I just upgraded my Mac to a mew 2014 MacBook Pro with Retina and Yosemite 10.10.1. I want to install my old HP Officejet Pro L7590. I have the printer connected by network cable to my Comcast network hub. There is a stable connection on both ends (li

  • IMovie 6 and general advice

    Amateur iMovie user (but not bad at it!), some general advice requested... 1. Is iMovie HD 6 worth buying (seems like there's a bit of grief associated with it), or can you get the same effects and titles etc with a 3-D party plugin to iMovie 5? I on

  • Comparing data b/w biw and oltp

    hi Could some one can halp me how to compare data between biw and oltp system.which has been extracted. Thank for your precious time spent to help me in learning. Thanks, Jagadeesh

  • Running 10.8 drivers on 10.7

    Hello there, We have a Mini Server running OSX 10.8 and 25 iMacs running on 10.7 that are all bound through Windows AD and OpenDirectory. We have purchased a printer that has both 10.7 and 10.8 drivers available, I installed the printer to the server

  • Explorer Cannot Display Web Page Desk Top 3000J11573​87-A11

    Originally worked fine displayed web page withOUT a problem FOR OVER A YEAR.  Starting in Jan 2008 (just after warranty EXPIRED) it just reports "cannot display web page"  Using my Xp computer I can get all of the web pages to respond.  Using interna