I am having trouble getting TreeCacheAop to add objects of a class which 
extends ArrayList.  According to the FAQ this is possible:

 anonymous wrote : TreeCacheAop supports classes extending from List, Set, and 
Map without users to declare them "aspectized". It is done via a dynamic proxy.

Simple objects such as Strings are being added and replicated with no errors, 
so the TreeCacheAop appears to be configured correctly.

The class in question extends ArrayList.  In my test code I create a new object 
of this class and try to add it to a TreeCacheAop using putObject().  At this 
point JBossCache bombs and throws an CacheException.  This happens using three 
separate scenarios with jboss-aop.xml: 1) no jboss-aop.xml at all, 2) using a 
jboss-aop.xml with an "advisable" entry for my class as specified in the 
example jboss-aop.xml from the jboss-cache distribution, and 3) using a 
jboss-aop.xml with a "prepare" entry for my class as described in the 
TreeCacheAop document. So it appears that the jboss-aop.xml file is having no 
effect on this behavior, or at least the error is the same for the three 
configurations I've tried.

Here is the exception stack trace:

 
  | 11:15:53,681 ERROR [TreeCacheTester] Unable to add a new UserMessages 
object for user ID JADAMS1
  | org.jboss.cache.CacheException: failure creating proxy; - nested throwable: 
(org.jboss.util.NestedRuntimeException: 
org.jboss.aop.proxy$com.harborsideplus.treecachetest.pojo.UserMessages; - 
nested throwable: (java.lang.InstantiationException: 
org.jboss.aop.proxy$com.harborsideplus.treecachetest.pojo.UserMessages))
  |         at 
org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:346)
  |         at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:130)
  |         at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:108)
  |         at 
com.harborsideplus.treecachetest.mbean.TreeCacheTester.getUserMessages(TreeCacheTester.java:165)
  |         at 
com.harborsideplus.treecachetest.mbean.TreeCacheTester.addUserMessage(TreeCacheTester.java:225)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:585)
  |         at 
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
  |         at 
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
  |         at 
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
  |         at 
org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:236)
  |         at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:202)
  |         at 
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:241)
  |         at 
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:79)
  |         at 
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:61)
  |         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  |         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
  |         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
  |         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
  |         at 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
  |         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
  |         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
  |         at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |         at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
  |         at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |         at 
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
  |         at 
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
  |         at 
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
  |         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |         at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |         at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
  |         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |         at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |         at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
  |         at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
  |         at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
  |         at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
  |         at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
  |         at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
  |         at java.lang.Thread.run(Thread.java:595)
  | Caused by: org.jboss.util.NestedRuntimeException: 
org.jboss.aop.proxy$com.harborsideplus.treecachetest.pojo.UserMessages; - 
nested throwable: (java.lang.InstantiationException: 
org.jboss.aop.proxy$com.harborsideplus.treecachetest.pojo.UserMessages)
  |         at 
org.jboss.cache.aop.CollectionInterceptorUtil.getMethodMap(CollectionInterceptorUtil.java:52)
  |         at 
org.jboss.cache.aop.CachedListInterceptor.<init>(CachedListInterceptor.java:39)
  |         at 
org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:344)
  |         ... 53 more
  | Caused by: java.lang.InstantiationException: 
org.jboss.aop.proxy$com.harborsideplus.treecachetest.pojo.UserMessages
  |         at java.lang.Class.newInstance0(Class.java:335)
  |         at java.lang.Class.newInstance(Class.java:303)
  |         at 
org.jboss.aop.proxy.ClassProxyFactory.newInstance(ClassProxyFactory.java:59)
  |         at 
org.jboss.cache.aop.CollectionInterceptorUtil.getMethodMap(CollectionInterceptorUtil.java:50)
  |         ... 55 more
  | 11:15:53,722 ERROR [TreeCacheTester] Unable to add a message to the 
UserMessagesManager for the user with ID JADAMS1
  | javax.management.MBeanException: Unable to add a new UserMessages object 
for user ID JADAMS1
  |         at 
com.harborsideplus.treecachetest.mbean.TreeCacheTester.getUserMessages(TreeCacheTester.java:171)
  |         at 
com.harborsideplus.treecachetest.mbean.TreeCacheTester.addUserMessage(TreeCacheTester.java:225)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:585)
  |         at 
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
  |         at 
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
  |         at 
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
  |         at 
org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:236)
  |         at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:202)
  |         at 
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:241)
  |         at 
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:79)
  |         at 
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:61)
  |         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  |         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
  |         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
  |         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
  |         at 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
  |         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
  |         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
  |         at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |         at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
  |         at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |         at 
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
  |         at 
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
  |         at 
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
  |         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |         at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |         at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
  |         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |         at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  |         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |         at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
  |         at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
  |         at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
  |         at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
  |         at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
  |         at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
  |         at java.lang.Thread.run(Thread.java:595)
  | Caused by: org.jboss.cache.CacheException: failure creating proxy; - nested 
throwable: (org.jboss.util.NestedRuntimeException: 
org.jboss.aop.proxy$com.harborsideplus.treecachetest.pojo.UserMessages; - 
nested throwable: (java.lang.InstantiationException: 
org.jboss.aop.proxy$com.harborsideplus.treecachetest.pojo.UserMessages))
  |         at 
org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:346)
  |         at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:130)
  |         at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:108)
  |         at 
com.harborsideplus.treecachetest.mbean.TreeCacheTester.getUserMessages(TreeCacheTester.java:165)
  |         ... 50 more
  | Caused by: org.jboss.util.NestedRuntimeException: 
org.jboss.aop.proxy$com.harborsideplus.treecachetest.pojo.UserMessages; - 
nested throwable: (java.lang.InstantiationException: 
org.jboss.aop.proxy$com.harborsideplus.treecachetest.pojo.UserMessages)
  |         at 
org.jboss.cache.aop.CollectionInterceptorUtil.getMethodMap(CollectionInterceptorUtil.java:52)
  |         at 
org.jboss.cache.aop.CachedListInterceptor.<init>(CachedListInterceptor.java:39)
  |         at 
org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:344)
  |         ... 53 more
  | Caused by: java.lang.InstantiationException: 
org.jboss.aop.proxy$com.harborsideplus.treecachetest.pojo.UserMessages
  |         at java.lang.Class.newInstance0(Class.java:335)
  |         at java.lang.Class.newInstance(Class.java:303)
  |         at 
org.jboss.aop.proxy.ClassProxyFactory.newInstance(ClassProxyFactory.java:59)
  |         at 
org.jboss.cache.aop.CollectionInterceptorUtil.getMethodMap(CollectionInterceptorUtil.java:50)
  |         ... 55 more
  | 


Any insight as to why this is happening and/or how I can work around this will 
be quite appreciated.  Thanks in advance.


--James

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3870041#3870041

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3870041


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to