Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I figure out what is not Serializable?  RSS feed

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using EJB < 3 for an app tier application. When I call a remote method from the web tier, I'm getting the below error . I suspect that something in the object being returned is not Serializable, but I can't figure out what, and everything I've checked is Serializable. Here is remote method signature being called ...



And here is the error ...




My PaymentRecord object has the following fields ...



Any ideas how I can start troubleshooting? - Dave
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The stack trace doesnt have NotSerializableException anywhere.
You can however check by serializing the object yourself immediately after it is created.



And if that throws an exception, you will have to traverse the object graph and apply the above code to each object.

ram.

Edit: Do you use the values() or the entrySet() of that map instance to populate some other instance variable? Both of are not serializable - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4756277

ram.
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a rating system on this thing, because your post gets 5 stars. As it happened, I was populating the return object from a Map.values() invocation. Changing that solved my problem.

Thanks, - Dave
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Alvarado wrote:Is there a rating system on this thing, because your post gets 5 stars.


There's no rating system here at JavaRanch. However, i think a "thank you, your post helped me fix the issue" always motivates the helpful poster
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, you can mark your topic as 'Resolved'.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!