2 Replies Latest reply on Oct 11, 2005 10:01 AM by Joe Reger

    TreeCacheAop on standalone Tomcat 5.5.7

    A T Newbie

      Hello,

      Please bear in mind that this is a lengthy message.

      I am trying to run TreeCacheAop as a backend datastore for my standalone Tomcat webserver. I have an example working with TreeCache and have tried to implement a TreeCacheAop with no success. I have read all the documentations but am still unclear on how to get an example running on a test JSP file. I have defined Person and Address objects similar to the examples included in the zip. These compile fine, but when I try to precompile the classes I run into problems. I have tried to run the command line compiler and my output is:

      $ java -cp ".;./jboss-aop-jdk50.jar;./jboss-common.jar;./javassist.jar;./concur
      rent.jar;./trove.jar" org.jboss.aop.standalone.Compiler ./com
      Build Successful: 331 ms

      But when I try to run my test JSP:
      System.out.println("-------------------AopManager.getAopTree()-------------------");
      TreeCacheAop tree = AopManager.getAopTree();
      System.out.println("-------------------new Person()-------------------");
      Person joe = new Person();
      joe.setName("Joe Black");
      joe.setAge(31);

      System.out.println("-------------------new Address()-------------------");
      Address addr = new Address();
      addr.setCity("Sunnyvale");
      addr.setStreet("123 Albert Ave");
      addr.setZip(94086);
      joe.setAddress(addr);

      try{
      System.out.println("-------------------tree.startService()-------------------");
      tree.startService();
      System.out.println("-------------------tree.putObject()-------------------");
      tree.putObject("/aop/joe", joe);
      joe.setAge(41);

      ArrayList lang = new ArrayList();
      lang.add("English");
      lang.add("Mandarin");
      joe.setLanguages(lang);
      }
      catch(Exception e){
      System.out.println("Caught an exception");
      e.printStackTrace();
      }
      finally{
      System.out.println("-------------------tree.stopService()-------------------");
      tree.stopService();
      }

      I receive the following errors:
      -------------------AopManager.getAopTree()-------------------
      - Found existing property editor for org.w3c.dom.Element: org.jboss.util.propert
      yeditor.ElementEditor@1a3ca10
      - configure(): attribute size: 19
      - setting cluster properties from xml to: UDP(mcast_addr=228.1.2.3;mcast_port=48
      866;ip_ttl=64;ip_mcast=true;mcast_send_buf_size=150000;mcast_recv_buf_size=80000
      ;ucast_send_buf_size=150000;ucast_recv_buf_size=80000;loopback=true):PING(timeou
      t=2000;num_initial_members=3;up_thread=false;down_thread=false):MERGE2(min_inter
      val=10000;max_interval=20000):FD_SOCK:VERIFY_SUSPECT(timeout=1500;up_thread=fals
      e;down_thread=false):pbcast.NAKACK(gc_lag=50;retransmit_timeout=600,1200,2400,48
      00;max_xmit_size=8192;up_thread=false;down_thread=false):UNICAST(timeout=600,120
      0,2400;window_size=100;min_threshold=10;down_thread=false):pbcast.STABLE(desired
      _avg_gossip=20000;up_thread=false;down_thread=false):FRAG(frag_size=8192;down_th
      read=false;up_thread=false):pbcast.GMS(join_timeout=5000;join_retry_timeout=2000
      ;shun=true;print_local_addr=true):pbcast.STATE_TRANSFER(up_thread=true;down_thre
      ad=true)
      -------------------new Person()-------------------
      -------------------new Address()-------------------
      -------------------tree.startService()-------------------
      - binding of DummyTransactionManager failed
      javax.naming.NamingException: Context is read only
      at org.apache.naming.NamingContext.checkWritable(NamingContext.java:902)

      at org.apache.naming.NamingContext.bind(NamingContext.java:830)
      at org.apache.naming.NamingContext.bind(NamingContext.java:170)
      at org.apache.naming.NamingContext.bind(NamingContext.java:186)
      at org.apache.naming.SelectorContext.bind(SelectorContext.java:170)
      at javax.naming.InitialContext.bind(InitialContext.java:359)
      at org.jboss.cache.transaction.DummyTransactionManager.getInstance(Dummy
      TransactionManager.java:32)
      at org.jboss.cache.DummyTransactionManagerLookup.getTransactionManager(D
      ummyTransactionManagerLookup.java:17)
      at org.jboss.cache.TreeCache.startService(TreeCache.java:1078)
      at org.jboss.cache.aop.MarshalledTreeCache.startService(MarshalledTreeCa
      che.java:83)
      at org.apache.jsp.debug.test1_jsp._jspService(org.apache.jsp.debug.test1
      _jsp:71)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
      .java:325)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
      95)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:214)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :825)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:738)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:526)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
      lowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
      ool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      - interceptor chain is:
      class org.jboss.cache.interceptors.CallInterceptor
      class org.jboss.cache.interceptors.LockInterceptor
      class org.jboss.cache.interceptors.CacheLoaderInterceptor
      class org.jboss.cache.interceptors.UnlockInterceptor
      class org.jboss.cache.interceptors.ReplicationInterceptor
      class org.jboss.cache.interceptors.CacheStoreInterceptor
      - cache mode is REPL_SYNC
      - sockets will use interface xxx.xxx.xxx.xxx
      - socket information:
      local_addr=xxx.xxx.xxx.xxx:3778, mcast_addr=228.1.2.3:48866, bind_addr=/xxx.xxx.xxx.xxx,
      ttl=64
      sock: bound to xxx.xxx.xxx.xxx:3778, receive buffer size=80000, send buffer size=150
      000
      mcast_recv_sock: bound to xxx.xxx.xxx.xxx:48866, send buffer size=150000, receive bu
      ffer size=80000
      mcast_send_sock: bound to xxx.xxx.xxx.xxx:3779, send buffer size=150000, receive buf
      fer size=80000

      -------------------------------------------------------
      GMS: address is xxx.xxx.xxx.xxx:3778
      -------------------------------------------------------
      - viewAccepted(): new members: [xxx.xxx.xxx.xxx:3778]
      - new cache is null (maybe first member in cluster)
      - state could not be retrieved (must be first member in group)
      - No transaction manager lookup class has been defined. Transactions cannot be u
      sed
      - interceptor chain is:
      class org.jboss.cache.interceptors.CallInterceptor
      class org.jboss.cache.interceptors.LockInterceptor
      class org.jboss.cache.interceptors.UnlockInterceptor
      - cache mode is local, will not create the channel
      -------------------tree.putObject()-------------------
      java.lang.IllegalArgumentException: TreeCacheAop.putObject(): Object type is nei
      ther aspectized nor Serializable. Object class name is .jboss.object
      s.Person
      at org.jboss.cache.aop.AopUtil.checkObjectType(AopUtil.java:90)
      at org.jboss.cache.aop.TreeCacheAopDelegate._putObject(TreeCacheAopDeleg
      ate.java:146)
      at org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:376)
      at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:255)
      at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:226)
      at org.apache.jsp.debug.test1_jsp._jspService(org.apache.jsp.debug.test1
      _jsp:73)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
      .java:325)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
      95)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:214)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :825)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:738)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:526)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
      lowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
      ool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      - afterCompletion() failed for org.jboss.cache.interceptors.CacheStoreIntercepto
      r$SynchronizationHandler@162ba99
      java.lang.IllegalStateException: Failed to rollback: thread is not associated wi
      th the connection!
      at org.jboss.cache.loader.JDBCCacheLoader$NonManagedConnectionFactory.ro
      llback(JDBCCacheLoader.java:1435)
      at org.jboss.cache.loader.JDBCCacheLoader.rollback(JDBCCacheLoader.java:
      574)
      at org.jboss.cache.interceptors.CacheStoreInterceptor$SynchronizationHan
      dler.afterCompletion(CacheStoreInterceptor.java:267)
      at org.jboss.cache.transaction.DummyTransaction.notifyAfterCompletion(Du
      mmyTransaction.java:260)
      at org.jboss.cache.transaction.DummyTransaction.rollback(DummyTransactio
      n.java:88)
      at org.jboss.cache.transaction.DummyBaseTransactionManager.rollback(Dumm
      yBaseTransactionManager.java:84)
      at org.jboss.cache.aop.TreeCacheAop.endTransaction(TreeCacheAop.java:359
      )
      at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:274)
      at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:226)
      at org.apache.jsp.debug.test1_jsp._jspService(org.apache.jsp.debug.test1
      _jsp:73)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
      .java:325)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
      95)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:214)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :825)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:738)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:526)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
      lowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
      ool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      Caught an exception
      org.jboss.util.NestedRuntimeException: TreeCacheAop.putObject(): ; - nested thro
      wable: (java.lang.IllegalArgumentException: TreeCacheAop.putObject(): Object typ
      e is neither aspectized nor Serializable. Object class name is .jbos
      s.objects.Person)
      at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:270)
      at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:226)
      at org.apache.jsp.debug.test1_jsp._jspService(org.apache.jsp.debug.test1
      _jsp:73)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
      .java:325)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
      95)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:214)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :825)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:738)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:526)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
      lowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
      ool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.IllegalArgumentException: TreeCacheAop.putObject(): Object
      type is neither aspectized nor Serializable. Object class name is .j
      boss.objects.Person
      at org.jboss.cache.aop.AopUtil.checkObjectType(AopUtil.java:90)
      at org.jboss.cache.aop.TreeCacheAopDelegate._putObject(TreeCacheAopDeleg
      ate.java:146)
      at org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:376)
      at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:255)
      ... 22 more
      -------------------tree.stopService()-------------------
      - stopService(): closing the channel
      - stopService(): stopping the dispatcher
      - default: DefaultServlet.serveResource: Serving resource '/favicon.ico' header
      s and data
      - default: DefaultServlet.serveResource: Serving resource '/index.html' headers
      and data
      - default: DefaultServlet.serveFile: contentType='text/html'
      - default: DefaultServlet.serveFile: contentLength=5478
      - default: DefaultServlet.serveResource: Serving resource '/Src/PortalLayout.js
      ' headers and data
      - default: DefaultServlet.serveFile: contentType='text/javascript'
      - default: DefaultServlet.serveFile: contentLength=4964
      - default: DefaultServlet.serveResource: Serving resource '/Src/PortalPrefSelec
      t.js' headers and data
      - default: DefaultServlet.serveFile: contentType='text/javascript'
      - default: DefaultServlet.serveFile: contentLength=4439
      - default: DefaultServlet.serveResource: Serving resource '/Src/Common.js' head
      ers and data
      - default: DefaultServlet.serveResource: Serving resource '/index.html' headers
      only
      - default: DefaultServlet.serveFile: contentType='text/html'
      - default: DefaultServlet.serveFile: contentLength=5478
      - default: DefaultServlet.serveResource: Serving resource '/index.html' headers
      and data
      - default: DefaultServlet.serveResource: Serving resource '/favicon.ico' header
      s and data
      - default: DefaultServlet.serveResource: Serving resource '/Images/NGMS_SDO_Log
      o.jpg' headers and data

      When I try to run the precompiler via ant:
      Buildfile: build.xml

      prepare:

      compile:
      [javac] Compiling 2 source files to C:\tomcat\webapps\ROOT\WEB-INF\clas
      ses
      [aopc] [debug] jboss.aop.class.path is NULL
      [aopc] [debug] jboss.aop.search.classpath: 'null' true
      [aopc] [debug] jboss.aop.path: C:\tomcat\webapps\ROOT\WEB-INF\src\jbos
      s-aop.xml
      [aopc] jboss.aop.path[0]: C:\tomcat\webapps\ROOT\WEB-INF\src\jboss-aop
      .xml
      [aopc] [deploying] file:/C:/tomcat/webapps/ROOT/WEB-INF/src/jboss-aop.
      xml
      [aopc] [trying to transform] jboss.objects.Address
      [aopc] [debug] There are no caller pointcuts!
      [aopc] [debug] was jboss.objects.Address converted: false
      [aopc] [no comp needed] C:\tomcat\webapps\ROOT\WEB-INF\classes\jboss\objects\Address.class
      [aopc] [trying to transform] jboss.objects.Person
      [aopc] [debug] There are no caller pointcuts!
      [aopc] [debug] was jboss.objects.Person converted: false
      [aopc] [no comp needed] C:\tomcat\webapps\ROOT\WEB-INF\classes\jboss\objects\Person.class
      [aopc] Build Successful: 851 ms

      BUILD SUCCESSFUL
      Total time: 7 seconds

      I run the same test JSP and receive the same exception.
      I would appreciate any help on understanding this.

      Arthur