• Post Reply Bookmark Topic Watch Topic
  • New Topic

Queue Serialization fails  RSS feed

 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

i am trying to serialize a PriorityQueue but i get an exception
the objects in the queue are serializable and it worked when i tried to only serialize an object from that queue.

is there a problem with serializing Queues ?
i checked where the exception is thrown.
When the queue tries to get the defaultWriteObject it crashes.

Thanks for advice
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give us the full stack trace from the exception?
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sure :-)


 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You said all your classes you have in the queue are serializable. You've checked and double checked com.downloadengine.model.connector.proxy.ProxyPool, right?
Was this class not serializable and you recently changed it to be serializable? Have you made sure the updated class has been distributed everywhere it needs to be? If the exception occurs on an application server, have you rebuilt and redeployed the application (WAR, EAR)?
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey ...

this is an extract of the ProxyPool class




now if i change the queue to be transient ... the process goes thru ...
here is the proxy bean class




there are no other objects other than primitives and strings associated to the proxybean class


hope that helps
 
Henry Wong
author
Sheriff
Posts: 22853
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey ...

this is an extract of the ProxyPool class


Does any of the methods of this class return an inner class? I don't think that it is this class that's the problem. It looks like the queue has an inner class of this class (which is not serializable).

Henry
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,

there is no inner class in neither of the two classes
the proxyBean mostly constists of getters and setters. .
the pool starts an independent thread thats all ...

 
Henry Wong
author
Sheriff
Posts: 22853
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sebastian Janisch wrote:hey,

there is no inner class in neither of the two classes
the proxyBean mostly constists of getters and setters. .
the pool starts an independent thread thats all ...



Well, that is what is it complaining about.... BTW, it is an anonymous inner class, so you can't find it by looking for the class keyword.

Henry
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is no inner class, nor anonymous in the ProxyBean class and that is where the problem is isnt it ??

is it helpful if i post the complete ProxyBean code so you can take a look at it ?
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Henry's on to something:


The exception reports the problem is with ProxyPool$1, and '$' indicates a compiler generated class name.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
too weird there is no inner class whatsoever defined...

this is the eclipse outline .. hope that helps

ProxyPool_Outline.gif
[Thumbnail for ProxyPool_Outline.gif]
Eclipse Outline
 
Rob Spoor
Sheriff
Posts: 20898
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check that private ProxyPool constructor. It has a + in front of it, which means it has something inside. Usually that is a method local or anonymous inner class.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gee you guys are fast :-)

that's whats inside the constructor

 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hold on

is that the inner class we are talking about ... gee i didnt see that thing
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok ...

i changed the constructor to the following and now it's working




thank you guys for your help
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!