|
Hi Michael,
I tried with ur suggestion..The following are my RMI pgms...
1.AddServerIntf.java (Interface Pgm)
------------------------------------
import java.rmi.*;
public interface AddServerIntf extends Remote
{
double add(double d1,double d2)
throws RemoteException;
}
2.AddServerImpl (Pgm that implements AddServerIntf.java)
========================================================
import java.rmi.*;
import java.rmi.server.*;
public class AddServerImpl extends UnicastRemoteObject
implements AddServerIntf
{
public AddServerImpl()throws RemoteException{}
public double add(double d1,double d2)
throws RemoteException
{
return d1+d2;
}
}
3.AddServer.java (pgm that Registers RMI)
==========================================
import java.rmi.*;
import java.net.*;
public class AddServer
{
public static void main(String args[])
{
try
{
System.setSecurityManager(new RMISecurityManager() );
AddServerImpl addServerImpl = new AddServerImpl();
Naming.rebind("AddServer" ,addServerImpl);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
4. AddClient.java (Client Pgm)
==============================
import java.rmi.*;
import java.net.*;
public class AddClient
{
public static void main(String args[])
{
try
{
String addServerURL="rmi://" + args[0] +"/AddServer";
// args[0] will contain IP address of my AS/400 server
AddServerIntf addServerIntf =
(AddServerIntf)Naming.lookup(addServerURL);
System.out.println("The first number is : "+args[1]);
double d1 = Double.valueOf(args[1]).doubleValue();
System.out.println("The second number is : "+args[2]);
double d2 = Double.valueOf(args[2]).doubleValue();
System.out.println("The sum is : "+addServerIntf.add(d1,d2));
}
catch(Exception e)
{
System.out.println(e);
}
}
}
Mike,i tried with ur options also by giving the default port number as 1099
but still when I execute "AddClient" followed by IP address of AS/400 server
and two parameters ,I get a message saying
"java.rmi.NotBoundException : AddServer",
I am confused...wud u bail me out of this crunch situation..
regards,
harish
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at
http://webmail.netscape.com.
+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.