Results 1 to 4 of 4
Thread: RMI program
- 03-25-2010, 07:14 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 9
- Rep Power
- 0
RMI program
Can some1 tell whats mistake with my code..
import java.rmi.*;
import java.net.*;
import java.rmi.server.*;
public interface AddServerIntf extends Remote {
double add(double d1, double d2) throws RemoteException;
}
public class AddServerImpl extends UnicastRemoteObject
implements AddServerIntf {
public AddServerImpl() throws RemoteException {
}
public double add(double d1, double d2) throws RemoteException {
return d1 + d2;
}
}
public class AddServer {
public static void main(String args[]) {
try {
AddServerImpl addServerImpl = new AddServerImpl();
Naming.rebind("AddServer", addServerImpl);
}
catch(Exception e) {
System.out.println("Exception: " + e);
}
}
}
I am getting error which says
M:\jdk1.5\bin\AddClient.java:6: cannot find symbol
symbol : class AddServerIntf
location: class AddClient
AddServerIntf addServerIntf =
^
M:\jdk1.5\bin\AddClient.java:7: cannot find symbol
symbol : class AddServerIntf
location: class AddClient
(AddServerIntf)Naming.lookup(addServerURL);
^
2 errors
I have no idea what should i do.
- 03-25-2010, 08:48 AM #2
does your code came from different java files?
freedom exists in the world of ideas
- 03-25-2010, 02:01 PM #3
Member
- Join Date
- Mar 2010
- Posts
- 9
- Rep Power
- 0
I dnt knw what you mean but if you are asking if my program has different segments yes it does..i got this prog from book which i am following
- 03-25-2010, 04:40 PM #4
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
I don't know what you mean by "segments" but from your example, you should have three separate source files: AddServerIntf.java, AddServerImpl.java, and AddServer.java.
And your error messages are coming from AddClient.java, the source of which you have not posted. Also, please use CODE tags when posting code.
-Gary-
Similar Threads
-
changing my program to array working program
By Chewart in forum New To JavaReplies: 39Last Post: 11-18-2009, 06:53 PM -
Execute A program from a Program!
By Moncleared in forum Advanced JavaReplies: 2Last Post: 02-22-2009, 04:17 PM -
Executing a program within a program
By gibsonrocker800 in forum New To JavaReplies: 5Last Post: 05-12-2008, 08:24 AM -
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM -
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks