Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Object cannot be serialized  RSS feed

 
meka toka
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a class A which has 7 default table models in it and its declaration is as following
public class A implements java.io.Serializable
{
}
Now class A is part of another class B whose declaration is as following
public class B implements java.io.Serializable
{
private A instanceA = new A();
public class B(String temp, A instanceA)
{
this.temp = temp;
this.instanceA = instanceA;
}//end of class B
Now i am having to send class B (wrapped in an object message) from the client to the server.
But when i am trying to add the object to the object message, i get the
following error
javax.jms.MessageFormatException: Object cannot be serialized
at org.jboss.mq.SpyObjectMessage.setObject(SpyObjectMessage.java:67)

--> I have done search over the net and read in a forum that String, though is serializable .. has a limit of 6000 characters. Likewise is there any limit in the above case ??
Between i am using
JBoss 3.0.2 server
And also when i look in the source code of SpyObjectMessage of Jboss, i noticed something.
http://www.thecortex.net/clover/eg/jboss/report/org/jboss/mq/SpyObjectMessage.html
In the above url between lines 67 and 76 there are some comments .. do they have any significance in this case ??

Thanks in advance
Meka Toka
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You said A contains 7 DefaultTableModels. A DefaultTableModel contains a Vector. Maybe one of the Vectors contain something that is not Serializable...
Kyle
 
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!