Reputation: 3374
I've a hash map like :
Map gen = HashMap<Integer, MyObj>
When I execute AccessController.doPrivileged(gen)
, it throws exception as follows. Can anyone help me on this.
java.security.PrivilegedActionException: java.io.NotSerializableException: java.util.HashMap
at java.security.AccessController.doPrivileged(Native Method)...
This code is getting executed in Weblogic
environment.
Upvotes: 1
Views: 6077
Reputation: 757
The objects you store in the Map
(in your case MyObj
) should implement the interface java.io.Serializable
Upvotes: 6
Reputation: 20323
Your key is Integer
which is Serializable
by default. What is inside MyObj
? I mean are there any objects inside MyObj
?
Upvotes: 4