Ben, thanks for your replies.

I managed to work around my problem with the overloaded method by not preparing the 
class that was causing the problem (it's just a value in a Map, and I'll just pretend 
it's immutable whilst I'm testing!).

So, I did manage to get my CounterLicense put into the cache, and it gets replicated 
OK, but changes the a Map object my class holds don't seem to be getting replicated - 
when I call a buisiness method on the CounterLicense class it does a put on the Map. 
Whilst the in-memory representation of Map on the server it was created contains the 
additional entry, I don't see it when I "printDetails" on the TreeCacheAop MBean on 
either of the servers I have clustered.

In the tutorial it mentions that you have to get the collection from the cache in 
order to get the dynamic proxy that has replaced the Map. So when I'm putting my 
CounterLicense into the cache I tried overriding it's reference to the Map with what I 
get from the cache:


  | treeCache.putObject(new Fqn("/licenses/lic123"), license);
  | license.setPropertyMap((Map)treeCache.getObject(new 
Fqn("/licenses/lic123/properties")));
  | 

but this causes a (not very useful) stack overflow:


  |         ...
  |         at javassist.ClassPool.toClass(ClassPool.java:713)
  |         at org.jboss.aop.deployment.JBossClassPool.toClass(JBossClassPool.java:50)
  |         at javassist.ClassPool.toClass(ClassPool.java:713)
  |         at org.jboss.aop.deployment.JBossClassPool.toClass(JBossClassPool.java:50)
  |                                                                                    
                                                                             
  |         at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:207)
  |         at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
  |         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
  | 

So I'm assuming that wasn't the right thing to do!

However, looking at printDetails in the JMX console, I'm not sure whether it's a proxy 
that's bound into the cache in place of the Map:

/licenses
  | /lic123
  | jboss:internal:class: class com.ingenta.ics.license.CounterLicense
  | AOPInstance: [EMAIL PROTECTED]
  | 
  | ... (other fields)...
  | 
  | /properties
  | jboss:internal:class: class java.util.HashMap
  | 
My environment is JBoss-4.0.0 using the included jboss-aop and jboss-cache versions, 
but with an upgraded version of javassist.jar.

Is this something that would be addressed by the upcoming Collection enhancements in 
the 1.2 release?

Regards,

-Andrew

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

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


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to