• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NotSerializableEception

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic