Women in Technology

Hear us Roar



Article:
  JBoss Cache as a POJO Cache
Subject:   cache2_.getObject("monitor") returns null
Date:   2005-11-18 17:16:21
From:   korosh
I am running the PropagationReplAopTest and it seems the PropgationManager put into cache1_ is not replicated in cache2_.



-------------------------------------------------------
GMS: address is 127.0.0.1:32996
-------------------------------------------------------


-------------------------------------------------------
GMS: address is 127.0.0.1:32998
-------------------------------------------------------
StateItem.setState(): id: 1000 state changed from 2000 to 1040
StateItem.setState(): id: 1001 state changed from 2000 to 1040
StateItem.setState(): id: 1002 state changed from 2000 to 1040
StateItem.setState(): id: 1003 state changed from 2000 to 1040
StateItem.setState(): id: 1000 state changed from 2000 to 1040
StateItem.setState(): id: 1001 state changed from 2000 to 1040
StateItem.setState(): id: 1002 state changed from 2000 to 1040
StateItem.setState(): id: 1003 state changed from 2000 to 1040
---------------------------------------------
Initial state
---------------------------------------------
Japan (Summary : 2000 [ok])
+ Tokyo (Summary : 2000 [ok])
+ + WindSensor1 (Summary : 2000 [ok])
+ + | ( name = power supply, id = 1000, state =1040)
+ + | ( name = sensor unit, id = 1001, state =1040)
+ + RainSensor1 (Summary : 2000 [ok])
+ + | ( name = power supply, id = 1002, state =1040)
+ + | ( name = sensor unit, id = 1003, state =1040)
+ Yokohama (Summary : 2000 [ok])
+ + WindSensor2 (Summary : 2000 [ok])
+ + | ( name = power supply, id = 1000, state =1040)
+ + | ( name = sensor unit, id = 1001, state =1040)
+ + RainSensor2 (Summary : 2000 [ok])
+ + | ( name = power supply, id = 1002, state =1040)
+ + | ( name = sensor unit, id = 1003, state =1040)



---------------------------------------------
Modified on Server #1
StateItem.setState(): id: 1003 state changed from 1040 to 1041
---------------------------------------------
Japan.Tokyo.RainSensor1: id: 1003 state: 1040->1041 (retrieved from cache #2)
---------------------------------------------


java.lang.NullPointerException
at test.propagation.PropagationReplAopTest.printStatus(PropagationReplAopTest.java:113)
at test.propagation.PropagationReplAopTest.testPropagation(PropagationReplAopTest.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)

Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • cache2_.getObject("monitor") returns null
    2005-11-21 18:34:32  bwang00 [View]

    Korosh,

    Usually the first problem using replication is troubleshoot multicast in your machine/network as this is always environment depedent. Towards this end, this is JGroups Wiki that can help you out:
    http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups

    If multicast works, then you can also run the JBoss Cache unit test suite that comes with the distro (target run.batch and run.aop.batch).

    -Ben
    • cache2_.getObject("monitor") returns null
      2005-11-23 12:57:40  korosh [View]

      Ben,
      thanks very much for pointing me in the right direction. Indeed multicast on my machine was misconfgiured.

      I had static ip assignment and yet in my /etc/hosts file I did not tie the IP address to my hostname. This resulted in multicast only listening to loopback. Thats the best explanation I have for it with my limited network knowledge.

      Now it works as expected.

      thanks
      k.
  • cache2_.getObject("monitor") returns null
    2005-11-20 16:01:05  bwang00 [View]

    How did you run it? Have you performed the aopc step to do POJO instrumentation first. Actually, if you have the 1.2.4 distro (like I mentioned in the article), under examples/aop/sensor, there is readme.txt. One of the easy step is to do, "build.bat run.aop.example" should run the corresponding ant target. Was it the step that you took?

    -Ben
    • cache2_.getObject("monitor") returns null
      2005-11-21 10:38:52  korosh [View]

      Hi Ben,

      I did it both ways. I run the ant target aopc directly from my IDE and then ran the test class.

      I also just ran the "run.aop.example" target from command line using Ant. same NullPointerException.

      I am on Linux(Debian), JDK 1.4.2, Ant 1.6.1.

      any ideas ?




      k.