2 Replies Latest reply on Nov 15, 2006 12:26 PM by kabirkhan

    Serilizability of aop proxy

    starksm64

      When I tried the JndiBinding in the server where the naming service serializes the entries, its failing because the wrapping aop container proxy is not:

      Caused by: java.io.NotSerializableException: AOPContainerProxy$0
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
      
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       at java.rmi.MarshalledObject.<init>(MarshalledObject.java:92)
       at org.jnp.interfaces.MarshalledValuePair.<init>(MarshalledValuePair.jav
      a:65)
       at org.jnp.interfaces.NamingContext.bind(NamingContext.java:562)
       ... 76 more
      


      I updated the org.jboss.test.microcontainer.test.JndiLifeCycleTestCase to serialize the bindngs, and although its not failing with this error, its not unserializing the bean correctly. Is the proxy expected to reproduce the underlying object behavior with regard to serialization?



        • 1. Re: Serilizability of aop proxy
          starksm64

          The NotSerializableException was valid as the target was not serializable. The only question is why the deserialization of the proxy is not restoring the underlying bean properties correctly.

          • 2. Re: Serilizability of aop proxy
            kabirkhan

            The problem was that the call to KernelControllerContextAware.setControllerContext() was happening as part of the InstantiateAction, i.e. before the bean was configured.

            In other words, when it was serialized/bound into jndi the state had not been set yet.

            I have moved the KernelControllerContextAware.set/unsetControllerContext() calls to the ConfigureAction for now, but we do need something a bit more fine-grained for these life-cycle aspects.