RE: problem with deployment
"Guijarro, Julio" <[email protected]>
| Newsgroups | gmane.comp.java.smartfrog.devel |
|---|---|
| Message-ID | <8D5B24B83C6A2E4B9E7EE5FA82627DC9854EC5@sdcexcea01.emea.cpqcorp.net> |
Hi Sai, I don’t see anything wrong in any of the information that you sent but you are using JAVA 1.5 and we haven’t extensively test SF with it. I would recommend you to use 1.4.2 instead. I think you have some networking configuration either in the switch or the network stack. We have run SF with Xen in many different configurations and we have never experienced a similar problem. Something you could do to eliminate options is to run a simple RMI program. Please, let me know if the example works in the situation you described previously. You can find a simple example in: http://yama-linux.cc.kagoshima-u.ac.jp/‾yamanoue/researches/java/rmi-ex2/ -------------- A Simple Java RMI example Takashi Yamanoue <http://yama-linux.cc.kagoshima-u.ac.jp/../‾yamanoue/index.html> , yamanoue-uRKy3hgZDr66M9fEvdmMO+0/[email protected] - The client program(RmiClient.class) sends a message to the server program(RmiServer.class). The server program print out the message on the console. - This example consists of the following files * MessageReceiverInterface.java * This part defines the RMI interface. The method (receiveMessage) of the server class, which implements this interface, is called from the remote client. In the remote client program, the type of the server class (which is the remote class in this client class) is this interface. * RmiServer.java * This is the server program(class). In this class, the method “receiveMessage”, which is called from the remote client, is defined. This class is the implementation of the RMI interface. * RmiClient.java * This is the client program(class). The remote method is called from this class. - Execution outline 1. RmiServer creates the “registry”. This is a kind of dictionary. Its key is a name (which is the ID of a remote object) and its content is an object. This object is looked up from a remote program by the name. This registry is accessed from a remote object by the IP address (or host name) and the port number. 2. RmiServer binds the name “rmiServer” and it-self(RmiServer.class) in the registry. 3. RmiClient looks up the remote object (RmiServer) by the name “rmiServer”. 4. RmiClient calls the method “receiveMessage” of the RmiServer class. 5. The method “receiveMessage” of the RmiServer class prints out the message. - Compile 1. javac RmiServer.java 2. rmic RmiServer 3. javac RmiClient.java - Execution 1. (at one host,) java RmiServer 2. (at another host) java RmiClient <server’s address> 3232 <message text> - The source codes ReceiveMessageInterface.java import java.rmi.*; public interface ReceiveMessageInterface extends Remote { void receiveMessage(String x) throws RemoteException; } RmiServer.java 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); } } } RmiClient.java 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(); } } } ________________________________ - References 1. Trail: RMI , in The JavaTM Tutorial, http://java.sun.com/docs/books/tutorial/rmi/ A brief overview of the RMI system and then walks through a complete client/server example that uses RMI's unique capabilities to load and to execute user-defined tasks at runtime. 2. Java Remote Method Invocation (Java RMI), http://java.sun.com/products/jdk/rmi/ ________________________________ From: smartfrog-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:smartfrog-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Dharanikota, Sai Sent: 14 February 2005 13:12 To: Guijarro, Julio; smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Subject: RE: [Smartfrog-developer] problem with deployment Hi Julio, These are the test results and I am attaching the files which contains the settings. ________________________________ From: Guijarro, Julio [mailto:[email protected]] Sent: Friday, February 11, 2005 11:15 AM To: Dharanikota, Sai; Goldsack, Patrick; smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Subject: RE: [Smartfrog-developer] problem with deployment Hi Sai, This is a very strange error. We have never experienced a similar problem. We think it must be a networking setup issue. Could you complete the following questions? - Are the two machines connected to the same switch or hub or are they in different subnets? The machines are connected to the same switch and they are in the same subnet. - Could you try if “NSLookup” works for both machines? NSLookup works for both machines - What OS do you run in these machines? We are currently running “Linux” ported on “Xen virtual machine monitor”( Xen is a resource virtualization software that sits between Linux and the actual hardware). - The SF daemon uses port 3800 for its RMI registry. Could you try to telnet into that port to see if is reachable before you try to deploy anything. I could able to telnet into the port 3800 before I try to deploy the components. - Just for completeness of info, could you send us the various settings that the sf display gives you on the help menu (help->info and help->info prop). You can save or copy the results in a file. Please, do this for both hosts. I have attached the files which contains the setting on the individual machines. I none of it tells us where the problem is we will think up some diagnostic tests…! Julio Guijarro Sai
image001.gif
(image/gif, 85.8 KB) - not displayed
image005.gif
(image/gif, 2 KB) - not displayed
image006.gif
(image/gif, 2.3 KB) - not displayed
image007.gif
(image/gif, 2.3 KB) - not displayed