-
1. Re: CacheLoader is not notified when a POJO is modified
dmary Dec 5, 2007 9:31 AM (in response to dmary)Hi,
I've got no response so I will precise more detail :) :
- i'm running with JBoss 4.0.5 GA
- i've got the JbossCache 1.4.0 SP1 dist
I've read all tutorials on JBossCache (TreeCache and PojoCache), i've read the wiki (PojoCacheAS405) and I didn't understand why any interceptor is called when I modifity one field of my POJO.
->
I've got 3 POJOs : object A contains object B which also contains object C
The object A use @InstanceOfPojoCacheable and object B and C use @PojoCacheable
I've reached the instance of PojoCache throught a MbeanMBeanServer server = MBeanServerLocator.locateJBoss(); try { this.cache = (PojoCacheMBean) MBeanProxyExt.create(PojoCacheMBean.class, "jboss.cache:service=MyPojoCache", server); this.cache.addTreeCacheListener(new MyCacheListener()); } catch (MalformedObjectNameException e) { e.printStackTrace(); }
I put my object in cache with putobject :public void putMobileUnit(ObjectA item) { try { this.cache.putObject(NODE+item.getImei(), item); } catch (CacheException e) { e.printStackTrace(); } }
In one hand, reading tutorials, the annotation @InstanceOfPojoCacheable and @PojoCacheable is the only need (i've reached this point) to have AOP worked, in other hand, as it is said on wiki PojoCacheAS405, we need to specify precisly the classes needed to be instrumented/aspectized in jboss-aop.xml and choose between make a Ant script to make a compile-time instrumentation or to do a load time instrumentation.
Why ? Instrumentation isn't done by only write annotations ?
What aopc task really do ?
Thanks a lot for ur responses !! -
2. Re: CacheLoader is not notified when a POJO is modified
dmary Dec 6, 2007 2:39 AM (in response to dmary)nobody can explain to me ?
-
3. Re: CacheLoader is not notified when a POJO is modified
dmary Dec 6, 2007 5:25 AM (in response to dmary)well, I've decided to use aopc precompile time mode, it well create my EAR.
but when I deploy my ear, now , I've got an error with a stateless EJB :Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: notifyObservers at org.jboss.aop.ClassAdvisor.attachClass(ClassAdvisor.java:312) at org.jboss.aop.AspectManager.initialiseClassAdvisor(AspectManager.java:590) at org.jboss.aop.AspectManager.getAdvisor(AspectManager.java:578) at com.masternaut.mastervcall.business.bean.MobileUnitBean.<clinit>(MobileUnitBean.java) ... 159 more Caused by: java.lang.NoSuchMethodException: notifyObservers at org.jboss.aop.ClassAdvisor.getMethod(ClassAdvisor.java:323) at org.jboss.aop.ClassAdvisor.getMethod(ClassAdvisor.java:331) at org.jboss.aop.ClassAdvisor.populateMixinMethods(ClassAdvisor.java:394) at org.jboss.aop.ClassAdvisor$1.run(ClassAdvisor.java:290) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.aop.ClassAdvisor.attachClass(ClassAdvisor.java:271)
anybody knows why I've got this error ? -
4. Re: CacheLoader is not notified when a POJO is modified
dmary Dec 6, 2007 5:56 AM (in response to dmary)It happend only on a stateless EJB (with local and remote interface) which have on several methods signature, a POJO use by jbosscache.
If I do not use aopc task, my project well deploy on Jboss AS
(Ps : I put AOP 1.5.2) -
5. Re: CacheLoader is not notified when a POJO is modified
dmary Dec 6, 2007 12:20 PM (in response to dmary)Nobody knows where can the problem for the exception
java.lang.NoSuchMethodException: notifyObservers
?
I think it could be eventualy one library is needed ..
Resume of what have been done :
1 - annotation on POJO
2 - xml file for create MBean cache with cacheloader in /deploy
3 - use of cache in java code
4 - creation of jboss-aop.xml for annotation in /deploy
5 - creation of jboss-aop.xml for preparing POJO in meta-inf of EAR
6 - ant task for aopc the POJOs
7 - replace of AOP 1.5.1 by 1.5.2 on my Jboss 4.0.5 AS
8 - put library of JBossCache 1.4.1 SP3 in Jboss lib
9 - run and crash .. :) -
6. Re: CacheLoader is not notified when a POJO is modified
jason.greene Dec 6, 2007 12:27 PM (in response to dmary)The NoSuchMethod typically means that your code was weaved with a different AOP descriptor at compile time, then what was used at run-time. It could also mean a different version of AOP.
-
7. Re: CacheLoader is not notified when a POJO is modified
dmary Dec 11, 2007 9:46 AM (in response to dmary)well, i've try to do again same deploy, with a fresh install of jboss 4.05 GA, and I found another error, and in searching into forum,
I found that someone have got same error
(see http://www.jboss.org/index.html?module=bb&op=viewtopic&t=98752&postdays=0&postorder=asc&start=10),
and the solution was to put into the classpath of aop task this :<fileset dir="${deploy.dir}/tc5-cluster.sar"> <include name="tc5-cluster.aop" /> </fileset>
thanks jason for the advice!