4 Replies Latest reply on Dec 19, 2008 6:47 AM by Newsgroup_User

    Blazeds Serialization

    saravanan.shun
      Hi while serializing the object from server, if instance variable doesnt contains the setter method the values becomes null in client side why this kind of restriction is there .

      please explain.
        • 1. Re: Blazeds Serialization
          fxBR
          Are your variables on the incoming object marked as private ?
          I had the same problem in the beginning and setting them as public solved my problem ...
          • 2. Re: Blazeds Serialization
            Level 7

            "fxBR" <webforumsuser@macromedia.com> wrote in message
            news:gido1p$6p0$1@forums.macromedia.com...
            > Are your variables on the incoming object marked as private ?
            > I had the same problem in the beginning and setting them as public solved
            > my problem ...

            In addition to that, this may help as well:
            http://flexdiary.blogspot.com/2008/11/thoughts-on-remoting.html


            • 3. Re: Blazeds Serialization
              saravanan.shun Level 1
              My class contains another object as instance variable in that object all variables are marked as protected and i have wrote setter method for some of the variables in my class that variables alone getting serialed .

              i have analyzed the blazeds source code in that BeanProxy class they have added condition as follows

              if (readMethod != null && isPublicAccessor(readMethod.getModifiers()) && (includeReadOnly || pd.getWriteMethod() != null))
              {
              ..............................
              }

              In this condition where the variables are filtered out. I am struggling with this issue . Any other options without writing setter methods to solve the problem.
              • 4. Re: Blazeds Serialization
                Level 7

                "saravanan.shun" <webforumsuser@macromedia.com> wrote in message
                news:gifdm0$bp8$1@forums.macromedia.com...
                > My class contains another object as instance variable in that object all
                > variables are marked as protected and i have wrote setter method for some
                > of
                > the variables in my class that variables alone getting serialed .
                >
                > i have analyzed the blazeds source code in that BeanProxy class they have
                > added condition as follows
                >
                > if (readMethod != null && isPublicAccessor(readMethod.getModifiers()) &&
                > (includeReadOnly || pd.getWriteMethod() != null))
                > {
                > ..............................
                > }
                >
                > In this condition where the variables are filtered out. I am struggling
                > with
                > this issue . Any other options without writing setter methods to solve the
                > problem.

                I think they have to be public for the serializing to work.

                Not sure what good it does anyway to have an object where _all_ properties
                are protected.