Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

inner classes and serilization  RSS feed

 
Marc Beck
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I am still working on my game, and I ran into the following problem:

I decided to turn some of my classes into inner classes and now I cannot load a saved game status anymore. I get a classNotFoundException. My inner classes and my outer class are all serializable. My inner classes are stored in arrayLists.

 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you wrote the objects to the file, did you write the ArrayList or the inner classes?
 
Marc Beck
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote the arraylists
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to load classes that were serialized before the changes you made or after?
 
Marc Beck
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for asking that question, Nitesh. That was exactly what was wrong. I tried to load a file that was serialized before I made the changes. I got the problem solved now.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am glad that you found the solution.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!