2 Replies Latest reply on May 26, 2007 5:58 AM by Fredrik Johansson

    Object is not replicated after field update

    Adrian Aisemberg Newbie

      I'm testing PojoCache with a cluster, on a windows system.
      After configuring everything, my cluster members receive replications.
      When i update an object's field, the changes are not replicated.
      For example:

      SimpleObject obj = new SimpleObject();
       cache.putObject("/simpleObject", obj);
       obj.setNumber(2); //Should replicate here???

      SimpleObject cachedObj = (SimpleObject)get("/simpleObject");
       cachedObj.getNumber(); //returns 2 on my machine, but 1 on other machines.

      When accessing the object from cluster members, i get the value of 1 on the number field, when accessing the same object from the machine that made the change, i get the value of 2.
      So, replication does work, otherwise, i would get null when accessing the node from other cluster members.
      But why doesn't it replicate the changes?


        • 1. Re: Object is not replicated after field update
          Fredrik Johansson Newbie

          Did you find out what the problem was? I'm fiddling around with pojocache myself and got the same error when running the examples from the distribution.

          • 2. Re: Object is not replicated after field update
            Fredrik Johansson Newbie

            As a note I finally got it working by adding the arguments:

            -javaagent:lib/jboss-aop-jdk50.jar -Djboss.aop.path=src/conf/META-INF/pojocache-aop.xml

            and copying the pojocache-aop.xml from the distribution /resources.

            I must say, I do find the documentation for this rather... confusing. It is not as concise at it could be anyway.

            I have one question though, in the documentation it states that you can either precompile classes or runtime by using a special system classloader. But in section 7 it says:

            7.3.1. Ant target for running load-time instrumentation using specialized class loader

            In JDK5.0, you can use the javaagent option that does not require a separate Classloader. Here are the ant snippet from one-test-pojo, for example.

            So... if I use this, do I still subsitute the system classloader or not?