Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

NotSerializableEception

 
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)
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • 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
 
get schwifty. tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic