This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes Using enum in remote object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using enum in remote object" Watch "Using enum in remote object" New topic
Author

Using enum in remote object

Benedikt Burgstaller
Greenhorn

Joined: Jun 25, 2005
Posts: 3
Hello folks,

i do have a class where i use fields of type enum and get a java.io.NotSerializableException.
As all the other fields are of a simple type (int, etc), i don't know, why this class isn't serializeable/remoteable. Maybe the enum is the problem.
The class 'NoteImpl' is transfered between a client and a server using RMI. The class 'Note' is the interface, containing all method definitions, which is required for Java-RMI.

Does anybody know what the problem is?

Thanks in advance
Benedikt

My class:
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36599
    
  16
If you are trying to serialize your class, does it implement java.io.Serializable? It won't serialize otherwise.

CR
Benedikt Burgstaller
Greenhorn

Joined: Jun 25, 2005
Posts: 3
Thanks a lot, works now, didn't think about that the right way. Should have found it myself, looking at it afterwards.

Thanks
Benedikt
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36599
    
  16
Only too glad to help
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Using enum in remote object
 
Similar Threads
How do I declare an arrayList and initilise it in a constructor Method
Help !!!! StringIndexOut.....
Out of Memory when testing a BMP Bean
Block Sliding Puzzle
TableRenderer with multiple lines of text