Hi,
I have written a class as ListenerImpl ;
--------------------------
----------
----------
----------
----------
----------
----------
----------
-----
package dbmscg.network;
import java.rmi.*;
import java.rmi.server.*;
import java.rmi.server.*;
import java.net.*;
public class ListenerImpl extends UnicastRemoteObject implements Listener {
//Default constructor.
public ListenerImpl() throws RemoteException{
}
public void test() throws RemoteException{
System.out.println("Testin
g...");
}
}
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----
And it implements Listener;
--------------------------
----------
----------
----------
----------
----------
----------
----
package dbmscg.network;
import java.rmi.*;
public interface Listener extends Remote {
public void test() throws RemoteException;
}
--------------------------
----------
----------
----------
----------
----------
----------
---
And I'm initializing ListenerImpl in another class ;
package dbmscg.server.servermanage
r;
import java.util.*;
import java.io.*;
import java.rmi.*;
import dbmscg.io.*;
import dbmscg.network.*;
public class Server {
public Server() {
}
//Main method for the system.
public static void main(String args[]) {
startServer();
}
//To start the server.
private static void startServer() {
boolean serverStarted = true;
//Create an instance of FileManager.
FileManager fileManager = new FileManager();
//Create an instance of ListenerImpl.
ListenerImpl serverListener = null;
try {
serverListener = new ListenerImpl();
String listenerServer = "//localhost/listenerserve
r";
Naming.bind(listenerServer
, serverListener);
System.out.println("Listen
er bound");
} catch (RemoteException r) {
System.err.println(r.getMe
ssage());
} catch (Exception e) {
System.err.println(e.getMe
ssage());
}
while (serverStarted=true) {
}
}
public void createDatabase(String DBname, String baseDir, Boolean automatic){
}
public void removeDatabase(String DBname) {
}
}
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
------
I have compiled all the classes. And used rmic on ListenerImpl.class. _Stub and _Skel class are there but when I try to run the server.class it always give the message;
RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalExceptio
n: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundExc
eption: dbmscg.network.ListenerImp
l_Stub
Please help.
Thanks in advance.
-Sanjaya