Simple  RMI question

I have completed reading tutorial...... i have understood How to code in RMI ?
How you can interact with other JVM and call remote methods....basically you need to write code for RMIServer { //  it will have interface and classes which implemets those interfaces } and also a RMIClient .
Client will look for rmiregistry and from the naming look up it will find out the remote object and then it calls the remote method.
I have got some question after reading the tutorial
Question 1:
in the binding
// implemented class in RMI server
public class PowerServiceServer extends UnicastRemoteObject
implements PowerService
// blah blah
Naming.bind ("PowerService", svr);   //  can i give  any name instead of  the Server  name  "PowerService"  ? 
bcoz  i saw  another tutorial where  they have coded  like  below ....
Naming.bind ("rmi://john/ServerName", svr);    //  note   "rmi :// "  ?  its different than above. why  "rmi://"  ?  Ho  many convention !!so It is misleading to me ......... can i give any name whatever i wish ( may not be SERVER name as well ) for Naming.bind ? like below
Naming.bind ("abcdefghijklmnop", svr); // IS IT LEGAL ?
or is there any convention or standard to follow ?
OR do i need to write the path localtion of my server in that string ?
like below...
Naming.bind ("c:/packagename/RMIServer", svr); ?
Plz correct me
thank you

You can use any name.yea......freedommmmmm............i like.
//host:port/namewell , if i use this convention then it will be like...
//CompName:1099/AnythingULike......right ?
thanks ?kaj i am happy .
I have some more queries.
Question 2 :
If you noticed my earlier post on "Stub and Skeleton" where ceil has given a fantastic explanation of what does this phrase means in programming point of view.
In fact while reading RMI tutorial i came across these two words . But after reading the tutorial it seems to me Author is misusing these 2 words.
see a comment from A CBT . i copied it in a notebook
The server generates the stub and the skeleton. THE STUB resides on the client side and the skeleton on the server. In the recent version the generating skeleton are not required unless compatibality is required.
To Generate stub and skeleton you can follow the command
rmic myserver ( ???)
plz note the statements which starts Capitalized . Its confusing .
THE STUB resides on the client side and the skeleton on the server.No.
Interfaces are there in the server code to make happy the compiler. so those are stubs and skeletons ( group of stubs) in the server.
there is NO STUB in the client side. its wrong.
To Generate stub and skeleton you can follow the command
rmic myserver ( ???)wow ...what is this ? some tutorials dont tell about this at all !!
i read a tutorial where they said the shortcut tips
(compile all source files + start rmiregistry + run server + run client )....thats it !!
tutorials are varryingggggggg.

Similar Messages

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Just a suggestion..........
    Download Thunderbird.  Easier to use when it comes to what you want to do w/your emails. 

  • 4 Simple Flash Questions that Are Stumping Me!

    What is the Frame Rate for Web Animations
    Q1. I am making an animation which will be played on the web. What is the default frame rate (fps) of Flash CS5? And what is the frame rate of for web?
    Q2. My animation needs to be 30 seconds long. So at 15 fps that would mean I need to use 600 frames in Flash?
    How Do I Mask everything so all I see is the Content on the Stage?
    I have a wide image that extends past my movies stage size so when I preview my movie the image is visible. How do I mask out anything that extends past my movies window size? I believe I can create a layer named "mask" and place it above all other layers, but I forget how to make the mask. Any help is appreciated.
    How to Fade a Graphic
    I have a graphic element (some type) and I want it to fade from 0% to 100%. In older versions of Flash I could just select the symbol and then set it's alpha value to 0%, move a few keyframes and then set the alpha to 100%. Voila! but now it doesn't seem to work that way. How can I do this in CS5?

    Ned, it says 24 fps which means there is 24 frames per second so each 24 frames is 1 second.
    Date: Fri, 4 Nov 2011 05:35:16 -0600
    From: [email protected]
    To: [email protected]
    Subject: 4 Simple Flash Questions that Are Stumping Me!
        Re: 4 Simple Flash Questions that Are Stumping Me!
        created by Ned Murphy in Flash Pro - General - View the full discussion
    1 You can create your character as a movieclip and copy/paste that movieclip from one file to another. 2. One way to create a movieclip is to copy all the frame of the animation's timeline (select them all, right click the selection, choose Copy Frames), then create a new movieclip symbol (Insert -> New Symbol...etc) right click on its only keyframe and chhose Paste Frames.  THat will put all the layers and frames you copied into the movieclip The only way to come close to being certain about the timing of you animation is to use code to keep track of the time, something like getTimer()..  The frame rate that a file plays at is not a reliable means of dictating the time it takes due to a variety of factors which include the amount of content you are trying to process and performance limits of the user's machine.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4007420#4007420
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4007420#4007420. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Flash Pro - General by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Simple performance question

    Simple performance question. the simplest way possible, assume
    I have a int[][][][][] matrix, and a boolean add. The array is several dimensions long.
    When add is true, I must add a constant value to each element in the array.
    When add is false, I must subtract a constant value to each element in the array.
    Assume this is very hot code, i.e. it is called very often. How expensive is the condition checking? I present the two scenarios.
    private void process(){
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
             if (add)
             matrix[i][ii][iii][...]  += constant;
             else
             matrix[i][ii][iii][...]  -= constant;
    private void process(){
      if (add)
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
             matrix[i][ii][iii][...]  += constant;
    else
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
           matrix[i][ii][iii][...]  -= constant;
    }Is the second scenario worth a significant performance boost? Without understanding how the compilers generates executable code, it seems that in the first case, n^d conditions are checked, whereas in the second, only 1. It is however, less elegant, but I am willing to do it for a significant improvement.

    erjoalgo wrote:
    I guess my real question is, will the compiler optimize the condition check out when it realizes the boolean value will not change through these iterations, and if it does not, is it worth doing that micro optimization?Almost certainly not; the main reason being that
    matrix[i][ii][iii][...]  +/-= constantis liable to take many times longer than the condition check, and you can't avoid it. That said, Mel's suggestion is probably the best.
    but I will follow amickr advice and not worry about it.Good idea. Saves you getting flamed with all the quotes about premature optimization.
    Winston

  • Simple RMI application

    Hi all
    I've wrote a simple RMI application; I've made a stub and a skeleton and I've started a rmiregistry; when I'm execute a server, I have this exception:
    java.rmi.UnmarshalException: error unmarshalling arguments; ecc.
    Where is the problem?

    Ok, but I'm a student and my teacher wants ....I'm 49 years old and have blond, long hair (other call it grey, but they are
    loonies) and I drive a Ford that doens't want to start when it's freezing
    but that's still no excuse for the RMI mechanism not to work properly ;-)
    Anyway, the problem was an sub-directory; now I catch a
    ConnectException: connection refused (to 127.0.0.1);
    any ideas?Yep, you have to start the server part first and then start your client. I also
    suspect that you don't have the 'rmiregistry' running ... (we can talk about
    that later).
    kind regards,
    Jos

  • SIMPLE RMI PROB

    I have created a very simple rmi test class passing a bk obkect to a remote library class - the code is below but i keep getting the oops error as specified in the client class - any ideas would be appreciated.
    public class bk{
    String st;
    public bk(String s){
    st=s;
    import java.rmi.*;
    public interface libint extends Remote{
    public void addbook(bk b)throws RemoteException;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.util.*;
    public class lib extends UnicastRemoteObject implements libint{
    Vector v;
    public lib()throws RemoteException{
    Vector v = new Vector();
    System.out.println("lib created");
    public void addbook(bk b){
    v.add(b);
    System.out.println("BOOK ADDED");
    import java.rmi.Naming;
    public class Server{
    public static void main(String args[]){
    try{
    Naming.rebind("libs", new lib());
    System.out.println("System ready");
    catch(Exception e){}
    import java.rmi.Naming;
    public class client{
    public static void main(String args[]){
    try{
    bk b = new bk("john");
    libint li = (libint)Naming.lookup("//127.0.0.1/libs");
    li.addbook(b);
    }catch(Exception e){System.out.println("oops2");}

    I kind of guessed it was something to do with the addbook method but i have no idea why - any suggestions would again be welcome - cheers
    java.lang.NullPointerException
    at lib.addbook(lib.java:15)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    at sun.rmi.transport.Transport$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at lib_Stub.addbook(Unknown Source)
    at client.main(client.java:8)

  • Problem with a simple RMI program

    I'm trying to get a simple RMI program to work, by following the instructions in this link:
    http://developer.java.sun.com/developer/technicalArticles/RMI/CreatingApps/index.html#dro
    When it gets to this line:
    Lookup look_obj = (Lookup)Naming.lookup(name);this exception is generated:
    java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
    What's wrong, eh?

    Canadian, eh?
    Looks like your security settings on you computer are set to not allow a socket connection.
    Specifically is is saying that access to port 1099 on your local machine (127.0.0.1 is the loopback address) is being denied.
    There are two main reasons this could happen (off the top of my head), though someone else might know from the message exaclty which one.
    1. Your java security permissions do not allow an out going socket connection (are you writing an applet?)
    2. Your computer protects access to port 1099.

  • A few simple Logic questions...please help.

    I have a few probably simple Logic questions, that are nonetheless frustrating me, wondering if someone could help me out.
    1. I run Logic 8, all of the sounds that came with logic seem to work except organ sounds. I can't trigger any organ sounds (MIDI) on Logic, they won't play. I have a Yamaha Motif as my midi controller.
    Any idea why?
    2. I've starting running into a situation where I will record a MIDI track, the notes are recorded but they won't playback. The only track effected is the one that was just recorded. All other midi tracks playback.
    I have to cut the track, usually go out of Logic and back in, re record for it to playback properly. Any idea why this may be happening?
    3. How important is it to update to Logic 9. Are there any disadvantages down the road if I don't upgrade. If I purchase the $200 upgrade, do I get a package of discs and material, or it just a web download.
    Any help is appreciated!
    Colin

    seeren wrote:
    Data Stream Studio wrote:
    3) You get a full set of disks and manuals.
    They're including manuals now?
    I think his referring to the booklets ...on how to install etc
    It would be great to see printed manuals though ...I love books especially Logic/Audio related !!
    A

  • Simple RMI error

    Hello,
    I'm trying to compile and execute a simple RMI example. The compilation is OK.
    The rmiregistry is running.
    I'm using windows and java 1.5
    I have the files:
    Server <== the Server
    myStudentImpl <== remote object
    myStudent <== interface
    myStudentImpl_Stub <== the Stub of myStudentImpl (generated by rmic)
    When I'm trying to execute the command from the Server file
    Naming.rebind("john",student);
    I'm getting an error.
    Error:RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: myStudentImpl_Stub
    Then I executed
    C:\myrmi2>java -Djava.rmi.server.codebase=c:/myrmic2 Server
    .... and I got the below error
    Error:Error unmarshaling return; nested exception is:
    java.net.MalformedURLException: unknown protocol: c
    Probably, I have a mistake with the environment variables.
    Can anybody help me, please?
    Thanks

    Now I'm getting
    Error(2):error marshalling arguments; nested exception is:
         java.io.NotSerializableException: testprovider.DS.DS_TicketImpl
    This is my interface
    public interface DS_Ticket extends Remote
    public EncryptedTicket RequestTicket(RequestForTicket req) throws RemoteException;
    This is my return object
    public class EncryptedTicket implements java.io.Serializable
    public byte[] cipherToken2;
    public byte[] cipherSignToken2;
    public byte[] cipherSignature;
    public String Description;
    This is the parameter object
    public class RequestForTicket implements java.io.Serializable
    public PublicKey pubKey;
    public byte[] e_s_Token2;
    public byte[] e_Token2;
    public byte[] BeKey;
    public byte[] BeToken;
    public byte[] signature;
    Any idea what I'm doing wrong?
    Thank you very much

  • How to deploy simple RMI server WLS 7

    Hi,
    I understand that if I write a simple RMI server - not
    extending UnicastRemoteObject, no clustering or IIOP
    issues - I don't need to run an rmic program. I'm not
    clear, however, on what then gets deployed. Does the
    client get the interface or implementation class? And, in
    this simple case, no deployment descriptor configuration
    for RMI is required, correct? I seem to be making this
    harder than it's supposed to be ...
    Thanks, Garry

    Garry, WLS itself is a server , you dont need an additional RMI server. All you need is create an RMI object and bind it to the server JNDI (from the server side) , then your clients can lookup the RMI object via the JNDI and they will get the stubs to make method invocations on the RMI object.
    Check out documentation at :
    http://e-docs.bea.com/wls/docs81/rmi/rmi_api.html#1000008693

  • Simple Quick Question

    wrong section, post was moved.
    Message was edited by:
    Rob17

    you titled "simple quick question"...
    .. complicated to answer..
    a) the TermsOfUse of the iTS don't allow any processing of purchased files, these are "copy protected"..
    b) iM has a voice-over function..
    c) iM is a video-edit app.. easy to use... just learn to handle it...
    d) iM allows to "extract" audio (=muting the original audio, adding your own..)
    e) to learn iM, spend some time here: http://www.apple.com/ilife/tutorials/imovie/index.html
    f) use pencil and paper first! WRITE and scribble, what shall happen when in your movie/parody... make a script, draw a storyboard .. THEN launch iM.. in other words: think first, then edit.. iM is just a tool, it does not "create"... Picasso needed a papertowel and half a stencil to create art....
    g) to get comfortable with iM, start with your own, small, short (3min!) project... import some stills, edit them, add a funny voice-over, add sounds, add music... good? make a bigger one...
    h) .. in our Lecture II, we teach you how to import shows from TV, youtube, wherever..
    standard disclaimer:
    be nice to ©opyrights ...

  • Simple query question

    hi all,
    I have a XMLType table with one column - I have presently one row, in my column xmlsitedata I have stored one large xml file.The schema definition is given below:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:element name="siteList">
    - <xs:complexType>
    - <xs:sequence>
    <xs:element name="site" type="siteType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    - <xs:complexType name="siteType">
    - <xs:sequence>
    <xs:element name="nameEn" type="xs:string" />
    <xs:element name="nameFr" type="xs:string" />
    </xs:sequence>
    <xs:attribute name="code" type="xs:string" />
    </xs:complexType>
    </xs:schema>
    I have executed the query below:
    select x.XMLSITEDATA.extract('/siteList/site/nameEn/text()').getCLOBVal() "stName" from wsitelist x;
    and I get all english names of some 200 locations, however, there is 1 row selected and all names show up on one row. How do I split them into 200 or whatever rows?
    Thanks,
    Kowalsky

    Have a look at the answer provided in the following thread.
    very simple XML question
    This may solve your problem.
    use xmlsequence.
    Alvinder

  • Simple rmi-ejb question

    Hi all!
    I'm a new to ejb, just started, for the beginning got an exception:
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at SimpleEjbTest.main(SimpleEjbTest.java:19)when trying to
      private static Context getInitialContext(String url, String user, String password) throws
          NamingException {
        Hashtable h = new Hashtable();
    //    h.put(Context.INITIAL_CONTEXT_FACTORY,
    //          "WHAT IS HERE?????");
        h.put(Context.PROVIDER_URL, url);
        h.put(Context.SECURITY_PRINCIPAL, user);
        h.put(Context.SECURITY_CREDENTIALS, password);
        return new InitialContext(h);
      }What to put into INITIAL_CONTEXT_FACTORY?
    Or you know easier way to make an InitialContext?
    Using jndi.properties? But what should it be then??
    Please help!
    Thanks a lot to alL!!
    Best regards, Boris.

    well, since you don't specify your app server, how's this?
    weblogic.jndi.WLInitialContextFactory
    if that doesn't work, try this
    com.inprise.j2ee.jndi.CtxFactory
    if that doesn't work, try this
    com.evermind.server.rmi.RMIInitialContextFactory
    if that doesn't work, try this
    org.jnp.interfaces.NamingContextFactory
    if that doesn't work, try this
    com.ibm.websphere.naming.WsnInitialContextFactory
    And if that doesn't work, look through your docs again, or maybe try google. Note that whatever you do, you have to have the appropriate jars on your classpath.
    Good Luck
    Lee

  • Help me to run this simple RMI example

    When i m running this example in standalone pc it works but while running on to different pc it gives error though I m giving the IP address from client of server.. If anyone can help me out plz help.
    Code:
    ReceiveMessageInterface
    import java.rmi.*;
    public interface ReceiveMessageInterface extends Remote
    void receiveMessage(String x) throws RemoteException;
    Server code:
    import java.rmi.*;
    import java.rmi.registry.*;
    import java.rmi.server.*;
    import java.net.*;
    public class RmiServer extends java.rmi.server.UnicastRemoteObject
    implements ReceiveMessageInterface
    int thisPort;
    String thisAddress;
    Registry registry; // rmi registry for lookup the remote objects.
    // This method is called from the remote client by the RMI.
    // This is the implementation of the �ReceiveMessageInterface�.
    public void receiveMessage(String x) throws RemoteException
    System.out.println(x);
    public RmiServer() throws RemoteException
    try{
    // get the address of this host.
    thisAddress= (InetAddress.getLocalHost()).toString();
    catch(Exception e){
    throw new RemoteException("can't get inet address.");
    thisPort=3232; // this port(registry�s port)
    System.out.println("this address="+thisAddress+",port="+thisPort);
    try{
    // create the registry and bind the name and object.
    registry = LocateRegistry.createRegistry( thisPort );
    registry.rebind("rmiServer", this);
    catch(RemoteException e){
    throw e;
    static public void main(String args[])
    try{
    RmiServer s=new RmiServer();
    catch (Exception e) {
    e.printStackTrace();
    System.exit(1);
    Client code:
    import java.rmi.*;
    import java.rmi.registry.*;
    import java.net.*;
    public class RmiClient
    static public void main(String args[])
    ReceiveMessageInterface rmiServer;
    Registry registry;
    String serverAddress=args[0];
    String serverPort=args[1];
    String text=args[2];
    System.out.println("sending "+text+" to "+serverAddress+":"+serverPort);
    try{
    // get the �registry�
    registry=LocateRegistry.getRegistry(
    serverAddress,
    (new Integer(serverPort)).intValue()
    // look up the remote object
    rmiServer=
    (ReceiveMessageInterface)(registry.lookup("rmiServer"));
    // call the remote method
    rmiServer.receiveMessage(text);
    catch(RemoteException e){
    e.printStackTrace();
    catch(NotBoundException e){
    e.printStackTrace();
    }

    When we compile with rmic skeleton and stub get created then we hav to place stub at each client ???Your remote client applcation need only _Stub.class fiels.
    Is there way by which we can know how many clients are connected to the
    server and there IP address, can anyone give the code... I guess that you should use a RMI login/logout method to register/unregister your client connection information into a databse or a simple static Hashtable(Vector) object.

  • Simple Report Question

    Post Author: scott123
    CA Forum: General
    I want to take the information in a simple excel table and recreate it 3 times, each time sorting/grouping on a different columnHere is the tableAnd here is the report that I'm trying to generate (first sorted by name, alphabetically, then grouped by rank, then grouped by size) I'm comfortable working with excel tables in Crystal, but I'm running into a problem repeating the information and then sorting each group separately. I also have no problem doing each group in a single report (without repeating any records), but I'd like to include all 3 groups in a single report.  My apologies for how remedial this question is- I thought for sure that Crystal could do this easily but I've spent a couple of days on this and am running into a brick wall.

    Post Author: pandabear
    CA Forum: General
    That's right Scott, and maybe make them "on demand"
    sub reports so the user only has to see the data they
    really want at the moment.  Gives the report a nice clean look too.
    PB

Maybe you are looking for

  • R12 Up Grade benifits for Purchasing, iProcurement,Inventory

    Dear All, We are planning to upgrade from 11i to R12, can any one help me what are new features in R12 for Purchasing, iProcurement,Inventory and waht are the benifits if we go for upgrade. Please let me know.. Regards, Kevin, P.

  • Crystal Deployment Issue

    I am having a problem deploying Crystal Reports to a test server. The site is an ASP.NET 4.0 site developed with Crystal version 13.0.1.220 engine for .NET. The site is deployed on Windows Server 2008 R2 64 bit using IIS 7 and Plesk. I've had multipl

  • HT1386 Why has iCloud taken days to sync my bookmarks.

    I have a huge dilemma.  I had the misfortune of turning on iCloud. And it began doing all its magical endeavors but now I have a huge mess.   It duplicated most of my songs in iTunes library it's been syncing my bookmarks in safari for days and I can

  • Multiple WLC and AP secondary config

    Hi all, we have 2 WLC, each licensed for 12 AP's. Here is the issue, we will have up to 20 Ap in our enviroment. No problem getting each AP assigned to a primary controller. My question is assinging an AP to a secondary. If I assign 10 AP's to each a

  • Errors during duplicating database.

    Hello, I'm duplicating my database (using RMAN) and I get the following error: contents of Memory Script: shutdown clone; startup clone nomount; executing Memory Script database dismounted Oracle instance shut down RMAN-00571(...) RMAN-04006:error fr