• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NotSerializableEception

 
Attila J´┐Żborszki
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

As I can see, I did everything similar to the method described in the Monkhouse book. I use RMI with RMI factory pattern.

During the tests, I can start the server and the client can connect to it but when I would like to instantiate my DBMain on the client side, I get a NotSerializableEception can be seen below.

What can be the problem?

Thanks,
Attila

java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableE
xception: suncertify.db.Data
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unkn
own Source)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
at suncertify.remote.$Proxy0.getDBMain(Unknown Source)
at suncertify.remote.ContractorDBConnector.getRemote(ContractorDBConnect
or.java:53)
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Champ, all objects that will be sent from an RMI server to the client (and vice-versa) must implement the java.io.Serializable interface.
 
Attila J´┐Żborszki
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Roberto Perillo:
Champ, all objects that will be sent from an RMI server to the client (and vice-versa) must implement the java.io.Serializable interface.


Thanks for the help, but a different issue caused the exception in my case.

In the Monkhouse book, the remote db class extends the original interface DBClient also:

public interface DvdDatabaseRemote extends Remote, DBClient {

But in my case, this does not work because of the introduction of some new exceptions in the database implementation.

In may case, this row looks like only

public interface DvdDatabaseRemote extends Remote {

Monkhouse could use his DvdDatabaseRemote as DBClient in the client side, but I can not do that ... but I tried to force it out ... and this was the problem ... now it works ...

Thanks,
Attila
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic