• 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

RMI Vector/ArrayList Serialization problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Im having a problem at the moment trying send a Vector which contains a serialized class objects from my server program to my client. Firstly i retrieve the contents of a file, store them into the serialized class "Reservation", i then add each new Reervation object to a Vector. I the wish to send this Vector to the client so it can print out the list of "Reservation Objects" from my Vector class. It prints out the value null. There seems to be a problem, with adding serialized objects to the Vector class. I thought The Vector class was serializable. There is no problem with the Serialized Reservation class. I can send it to/from the client/server no problem. Any help with this problem would be greatly appreciated.

Thanks,

Dave.

Code:



[Andrew: Put code between [code] and [/code] UBB tags]
[ April 22, 2005: Message edited by: Andrew Monkhouse ]
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dave,

Welcome to JavaRanch and this forum.

You will notice that I have edited your post to put the code between

Then printing them out at the far end:



When I run this I get the following output:



Note that I am using JDK 1.5 which does some nicer things with displaying contents of Collections, and also allows me to use Generics in my SocketClient.

So starting with that code as a basis, you should be able to see that you can send a Vector containing Serialized Objects through sockets. Perhaps you can create some dummy data to fit into your Reservation instance, and plug it into the code above to see if this is working? Then put in the real data into the Reservation instance and see if it still works, and so on, until you work out where things start to break.

Regards, Andrew
 
reply
    Bookmark Topic Watch Topic
  • New Topic