Hi all :
After reading a lot of the discussions here , I started my
SCJD journey .
But now I encounter a problem .
I have a ConnectionFactory as the rmi server , which stores the LockManager and the Data class in the instance variable . It runs ok . But when trying the getConnection() method , it throws Exception , the getConnection() method is like this :
public void getConnection(){
DBConnection dbConn = new DBConnectionRemote(data ,lockManager);
}
And the constructor of DBConnectionRemote is :
public DBConnectionRemote(Data data ,LockManager lockManager) throws RemoteException {
dbLockManager = lockManager;
dbData = data ;
}
The Exception shows :
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.WriteAbortedException: Writing aborted by exception; java.io.NotSerializableExceptio
n: suncertify.db.Data
After reading Mark Spritzler's article , I know that the data should not be Serliazable through server to client . But how to deal with it ? The DBConnectionRemote is already implements Remote . It should be identified as remote object ?
Any reply will be appreciated . Thank you in advance .