2 Replies Latest reply on Jan 27, 2006 5:36 PM by anupama oruganti

    Getting complex POJO working with TreeCacheAOP

    Joe Reger Newbie

      Hi All!

      Still getting closer to having everything working... thanks for bearing with me. I've gotten over the jgoups configuration, TreeCacheAOP configuration, aop annotation and compiling... but I'm still getting one error that I can't seem to debug.

      I'm running TreeCacheAOP in LOCAL mode. I've got the following debugging on:

      log4j.logger.org.jboss.cache=DEBUG
      log4j.logger.org.jgroups=DEBUG
      log4j.logger.org.jboss.util=DEBUG


      The object I'm trying to put into the cache is admittedly complex. I've been able to put simple aspectized objects in, but this complex one just won't go. With the debugging above I get a ~30Mb stdout log. Everything appears to work perfectly until way down at the bottom which says:

      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.TreeNode - acquiring RL: fqn=/usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86/accountuser/accountsUserHasAccessTo, caller=Thread[http-127.0.0.1-80-1,5,main], lock=<unlocked>
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.TreeNode - acquired RL: fqn=/usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86/accountuser/accountsUserHasAccessTo, caller=Thread[http-127.0.0.1-80-1,5,main], lock=read owners=[Thread[http-127.0.0.1-80-1,5,main]]
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.TreeCache - _get("/usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86/accountuser/accountsUserHasAccessTo", AOPInstance, "false")
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.interceptors.UnlockInterceptor - releasing lock for /usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86/accountuser/accountsUserHasAccessTo: read owners=[Thread[http-127.0.0.1-80-1,5,main]]
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.interceptors.UnlockInterceptor - releasing lock for /usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86/accountuser: read owners=[Thread[http-127.0.0.1-80-1,5,main]]
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.interceptors.UnlockInterceptor - releasing lock for /usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86: read owners=[Thread[http-127.0.0.1-80-1,5,main]]
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.interceptors.UnlockInterceptor - releasing lock for /usersession: read owners=[Thread[http-127.0.0.1-80-1,5,main]]
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.aop.collection.CollectionInterceptorUtil - invke(): invoke non-managed method: public java.util.Enumeration AOPClassProxy$0.keys()
      12171 [http-127.0.0.1-80-1] DEBUG org.jboss.util.NestedThrowable - org.jboss.util.NestedThrowable.parentTraceEnabled=true
      12171 [http-127.0.0.1-80-1] DEBUG org.jboss.util.NestedThrowable - org.jboss.util.NestedThrowable.nestedTraceEnabled=false
      12171 [http-127.0.0.1-80-1] DEBUG org.jboss.util.NestedThrowable - org.jboss.util.NestedThrowable.detectDuplicateNesting=true
      12171 [http-127.0.0.1-80-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[jsp] - Servlet.service() for servlet jsp threw exception
      org.jboss.util.NestedRuntimeException: CollectionInterceptorUtil.invoke(): targetObject is null. Can't invoke public java.util.Enumeration AOPClassProxy$0.keys()
       at org.jboss.cache.aop.collection.CollectionInterceptorUtil.invoke(CollectionInterceptorUtil.java:132)
       at org.jboss.cache.aop.collection.CachedMapInterceptor.invoke(CachedMapInterceptor.java:108)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at AOPClassProxy$0.keys(AOPClassProxy$0.java)
       at org.apache.jsp.myhome.index_log._jspService(org.apache.jsp.myhome.index_log:717)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
       at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:278)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:831)
       at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:652)
       at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1203)
       at java.lang.Thread.run(Unknown Source)


      The top of the log is just TreeCache going through each property of each element, building its tree... ~30Mb of entries like this:

      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.TreeNode - acquiring RL: fqn=/usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86/account/lastbillingcheck, caller=Thread[http-127.0.0.1-80-1,5,main], lock=<unlocked>
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.TreeNode - acquired RL: fqn=/usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86/account/lastbillingcheck, caller=Thread[http-127.0.0.1-80-1,5,main], lock=read owners=[Thread[http-127.0.0.1-80-1,5,main]]
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.interceptors.UnlockInterceptor - releasing lock for /usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86/account/lastbillingcheck: read owners=[Thread[http-127.0.0.1-80-1,5,main]]
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.interceptors.UnlockInterceptor - releasing lock for /usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86/account: read owners=[Thread[http-127.0.0.1-80-1,5,main]]
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.interceptors.UnlockInterceptor - releasing lock for /usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86: read owners=[Thread[http-127.0.0.1-80-1,5,main]]
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.interceptors.UnlockInterceptor - releasing lock for /usersession: read owners=[Thread[http-127.0.0.1-80-1,5,main]]
      12156 [http-127.0.0.1-80-1] DEBUG org.jboss.cache.eviction.LRUPolicy - nodeVisited(): is an aop node. fqn- /usersession/UserSessionF964D2EC8178E384973F6B72EC02CC86/account/lastbillingcheck size of children is 0


      The property that it appears to have problems with is accountsUserHasAccessTo. This is declared inside of an aspectized POJO as:

      private Hashtable accountsUserHasAccessTo = new Hashtable();


      Initially I thought it had something to do with this particular property. I commented it out throughout the class and rebuilt my app. But another similar error popped up.

      Again and again I tried removing things from my POJOs.

      Sometimes the error appeared to be on a Hashtable(). Sometimes a Calendar(). But I kept seeing the same error message each time:

      12171 [http-127.0.0.1-80-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[jsp] - Servlet.service() for servlet jsp threw exception
      org.jboss.util.NestedRuntimeException: CollectionInterceptorUtil.invoke(): targetObject is null. Can't invoke public java.util.Enumeration AOPClassProxy$0.keys()
       at org.jboss.cache.aop.collection.CollectionInterceptorUtil.invoke(CollectionInterceptorUtil.java:132)
       at org.jboss.cache.aop.collection.CachedMapInterceptor.invoke(CachedMapInterceptor.java:108)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at AOPClassProxy$0.keys(AOPClassProxy$0.java)


      It always says that "targetObject is null. Can't invoke public java.util.Enumeration AOPClassProxy$0.keys()". Whether I'm working with a Calendar or a Hashtable.

      So I'm trying to figure out what's happening.

      1) I think I've got the highest level of debug visibility on. Are there any other classes/packages I could watch to get more info?

      2) Are there certain things that just don't work well with TreeCacheAOP? Like Hashtables and Calendars?

      3) Could this be a version conflict between jars? I used the jars from jbosscache and then jboss-aop-jdk50.jar from the JBossAOP distro.

      4) What can you tell me about the error message? Does it tell you anything? I'm new to this and may be missing it.

      Thanks again for all of the help... one step closer!

      Best,

      Joe