[JBoss AOP] - Inteception on field inherited through generic superclass
by dunks80
JBoss 4.0.5.GA
JBoss AOP 1.5.2.GA load time weaving
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0-b105, mixed mode)
I'm seeing the following unexpected behavior
| public abstract class A
| {
| @MyFieldAnnotation
| protected Object myField;
| ...
| }
|
|
| public abstract class B<Z> extends A
| {
| ...
| }
|
| public class C extends B<Y>
| {
| ...
| }
|
| @InterceptorDef(scope = Scope.PER_VM)
| @Bind(pointcut = "get(* *->@MyFieldAnnotation)")
| public class MyFieldInterceptor implements Interceptor
| {
| ...
| }
|
|
When i try to call myField on an instance of C from within a method in C my interceptor is not run. However if I duplicate the annotated field in class B like this...
| public abstract class A
| {
| @MyFieldAnnotation
| protected Object myField;
| ...
| }
|
|
| public abstract class B<Z> extends A
| {
| @MyFieldAnnotation
| protected Object myField;
| ...
| }
|
...then the interceptor works when calling myField from an instance of C. I'm guess that since B is generic some sort of erasure of the annotation is happening. As a work around in the meantime I've just duplicated the annotated field. I just wanted to know whether this issue was known to the developers (if not I'll post it to jira) and whether or not there was some way to get this working without the need to duplicate that field.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999553#3999553
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999553
19 years, 4 months
[JBoss jBPM] - Re: Exception on scheduler launch
by Vlad Tepesch
Great, it's seems to be that.
I think my hibernate.cfg.xml overide the default hibernate.cfg.xml of jbpm :)
The exception change, and I think it's the end of the problem.
runtime exception while executing timers
| org.hibernate.HibernateException: Could not instantiate cache implementation
| at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:64)
| at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:214)
| at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
| at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)
| at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:74)
| at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:78)
| at org.jbpm.persistence.db.DbPersistenceService.getSchedulerSession(DbPersistenceService.java:244)
| at org.jbpm.JbpmContext.getSchedulerSession(JbpmContext.java:529)
| at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:103)
| at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
| Caused by: org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
| at org.hibernate.cache.NoCacheProvider.buildCache(NoCacheProvider.java:21)
| at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:61)
| ... 9 more
I will try to find it (but you can still respond, your knowledge seems more structured than those I found :) ) Thanks for all, it's so pleasant, even if the scheduler don't yet work, to see all this mapping collection success message :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999552#3999552
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999552
19 years, 4 months