5 Replies Latest reply on Jul 29, 2004 4:20 AM by belaban

    TreeCacheAop, POJO and ClassNotFoundException

    tolik

      Hello everybody.

      I've just encountered a problem that can't figure out how to solve.
      I tried to put a POJO precompiled by aopc into the cache.
      Everything looks right if cache is used in the LOCAL mode.
      But when i've turned it to either REPL_ASYNC or REPL_SYNC mode every putObject call throws the exception

      java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: MyPOJO
      at org.jgroups.Message.getObject(Message.java:222)
      at org.jgroups.blocks.RpcDispatcher.handle(RpcDispatcher.java:321)
      at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:581)
      at org.jgroups.blocks.RequestCorrelator.access$100(RequestCorrelator.java:39)
      at org.jgroups.blocks.RequestCorrelator$Request.run(RequestCorrelator.java:812)
      at org.jgroups.util.ReusableThread.run(ReusableThread.java:215)
      at java.lang.Thread.run(Unknown Source)

      The exception doesn't happen If only one instance of TreeCacheAop remains in the system.

      That error is quite strange as object of MyPOJO class has been just created, so the class had been successfuly resolved.

      It seems i've overlooked some a base thing.
      Can anybody help me to avoid the error.

        • 1. Re: TreeCacheAop, POJO and ClassNotFoundException

          Is it possible you can post a test case for me to verify? Als is this a standalone test case? If it is, the junit test suite has one that test the aop cache replication. Can you check it out?

          -Ben

          • 2. Re: TreeCacheAop, POJO and ClassNotFoundException
            tolik

            Hello Ben.

            I try to run TreeChaceAop standalone.
            run.aopc.batch task runs with AopLRUPolicyUnitTestCase failure only.
            But I can't make it to work as separate (not ant) task.
            The error happens the same as above does.
            Here is the script i use to run the ReplicatedAopTest from JBossCache home dir.

            #!/bin/sh
            CACHE_HOME=.
            sh $CACHE_HOME/build.sh aopc
            for nextjar in `ls $CACHE_HOME/lib/*.jar`
            do
             LIBS=$LIBS:$nextjar
            done
            export CLASSPATH=$LIBS:$CACHE_HOME/output/build:$CACHE_HOME/output/etc
            java junit.swingui.TestRunner org.jboss.test.cache.test.standAloneAop.ReplicatedAopTest


            It seems Ant helps to the Cache in some odd way. Can't imagine how.




            • 3. Re: TreeCacheAop, POJO and ClassNotFoundException

              You meant if you run it under jboss-cache:

              sh build.sh run.aop.examples -Dtest=org.jboss.test.cache.test.eviction.AopLRUPolicyUnitTestCase

              It will not fail?

              -Ben

              • 4. Re: TreeCacheAop, POJO and ClassNotFoundException
                tolik

                Hi Ben.
                This time i obtained no error of AopLRUPolicyUnitTestCase test in both tasks run.aop.examples and run.aopc.batch.
                But CacheTreeAop doesn't really work as standalone app.

                Does the script above run the test without exceptions for you? Have you tried it?
                if so then my jvm is something wrong with. But it's unlike to be reasone as i get the same result on Linux and Windows platforms.

                • 5. Re: TreeCacheAop, POJO and ClassNotFoundException
                  belaban

                  Okay, can you try with the latest JGroups (from CVS head) ?

                  The change I made is that now, incoming messages that contain objects are un-serializing those objects using the context classloader. This may have caused the problem.
                  Let me know if this solves your problem.

                  Bela
                  P.S.: I'll integrate the new version of JGroups into JBoss in ca. 2 weeks time