Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot be cast to java.io.Serializable

 
Predrag Ristic
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my database there si one to one relationship between person and role.Role has a composite primary key so I'm using RokePk class to map that.When I try to read a certain user from the database this exception occurs:"com.spinnaker.pedja.Role cannot be cast to java.io.Serializable".Here are the classes:

Person.java:


Role.java


RolePk.java:


Any ideas?
 
Travis Hein
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe make the Role and Person beans also implement Serializable interface. The RolePk bean does.
 
Predrag Ristic
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved.Thanks!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic