OK. I tried your code as you provided it and with a couple of variations:
1) I've got the same exception when trying the example as it was. 2) I changed inner class A to be static. Then it worked. 3) I changed inner class A to implement Serializable, and of course that worked too.
The conclusion I get from the fore mentioned 'experiments' is that instantiation of inner class A (remember the JVM needs to call the no-args constructor as that class does not implement Serializable) fails because the JVM needs an instance of the Outer class in order to be able to call the constructor. That is why it worked when I changed A to be a static inner class (no instance needed) or when I declared A serializable (no instantiation needed).
What do you think? Am I on the good track on this one? I expect your commnents. [ June 08, 2007: Message edited by: Sergio Tridente ]
I was going to move this, but changed my mind. As Sergio wrote making the class A Serializable seems to fix the problem. There are also a few discussions on the net about the ickiness of serializing instances of inner classes. [ June 08, 2007: Message edited by: Barry Gaunt ]