Hello everyone,
I trying to compile this simple RMI chat example from Oreilly
Java Servlet Programming book. This example has 3 parts, ChatClient.java, ChatServer.java and ChatServlet.java. I will post some of the example code here or you can download all 3 files from my server at this address.
http://www.powerleap.com/downloads/RMI-Chat-Code.zip ----------ChatClient.java---------------
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface ChatClient extends Remote {
public void setNextMessage(
String message) throws RemoteException;
}
-------------END--------------------------
This compiles just fine but the when i try to compile either of the other two examples like lets say. ChatServer.java i get this error.
---------- Java Compiler ----------
ChatServer.java:8: cannot resolve symbol
symbol : class ChatClient
location: interface ChatServer
public void addClient(ChatClient client) throws RemoteException;
^
ChatServer.java:9: cannot resolve symbol
symbol : class ChatClient
location: interface ChatServer
public void deleteClient(ChatClient client) throws RemoteException;
^
2 errors
Output completed (1 sec consumed) - Normal Termination
--------------end compile----------------------
The code for the chat server is short so i'll post it. here it is.
--------------ChatServer-----------------------
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface ChatServer extends Remote {
public String getNextMessage() throws RemoteException;
public void broadcastMessage(String message) throws RemoteException;
public void addClient(ChatClient client) throws RemoteException;
public void deleteClient(ChatClient client) throws RemoteException;
}
--------------END------------------------------
From the error returned by the compiler it looks like ChatServer.java has to import ChatClient some how. To give you some background i've got all the correct Jar files needed and i'm compiling on my personal computer before uploading to my Solaris server. The ChatClient.class file is in the same directory as the ChatServer.java file i'm tring to compile. Any help on this would be greatly appreciated.
Thanks,
Brian