Hello,
I receive the newsletter from aspectwerkz.codehaus.org, an AOP framework. One message mentioned, that aspectwerkz 0.10 and hibernate do not work together, when hibernate tries to enhance the bytecode.
So the general questions I asked myself is: Is there a danger, that independent tools (which could theoretically become very powerfull together) are incompatible one to each other, since they cannot handle the enhancements of the others?
Wouldn't it be very sad, if the most advanced persistence layer did not work together with the most innovative AOP framework (I'm not an expert, but it sounds good ;-) )?
Is there a need for a bytecode enhancement standard, so that multiple frameworks can work together?
Or is this not a problem at all? (aspectwerkz is beta, every mature framework will automatically work together with hibernates byte code enhancement)
Salut
Thomas
P.S. here the posting that inspired me:
Hi,
I tried to intercept constructor of a class persisted by hibernate2 using
aspectwerkz 0.10.
But it throws following exception. Is this a bug?
I hope aspectwerkz 0.10 can be applied to Hibernate persisted objects.
CGLIB proxy seems causing this problem.
regards,
nn
----
/**
* @Aspect perInstance
*/
public class AAspect extends Aspect {
/**
* @Around execution(dao.impl.*.new(..))
*/
public Object instanceCreationIC(final JoinPoint joinPoint) throws
Throwable {
...
}
}
----
[exec] Apr 7, 2004 9:39:30 PM net.sf.hibernate.util.ReflectHelper
getBulkBean
[exec] INFO: reflection optimizer disabled for: dao.impl.ABean,
CodeGenerationException:
org.codehaus.aspectwerkz.exception.WrappedRuntimeException-->null
[exec] java.lang.ExceptionInInitializerError
[exec] at WeblogAdaptorTest.main(Unknown Source)
[exec] Caused by: net.sf.cglib.core.CodeGenerationException:
java.lang.NoSuchMethodError-->net.sf.cglib.reflect.FastClass: method
<init>()V not found
[exec] at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:269)
[exec] at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:254)
[exec] at
net.sf.cglib.reflect.FastClass$Generator.firstInstance(FastClass.java:104)
[exec] at
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:
190)
[exec] at net.sf.cglib.reflect.FastClass$Generator.create(FastClass.java:92)
[exec] at net.sf.cglib.reflect.FastClass.create(FastClass.java:74)
[exec] at
net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPers
ister.java:757)
[exec] at
net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:715)
[exec] at
net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFa
ctory.java:41)
[exec] at
net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
[exec] at
net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:75
0)
[exec] at com.ontopsi.util.orm.TransactionManager.<clinit>(Unknown Source)
[exec] ... 1 more
[exec] Caused by: java.lang.NoSuchMethodError:
net.sf.cglib.reflect.FastClass: method <init>()V not found
[exec] at dao.impl.ABean$$FastClassByCGLIB$$926aceb6.<init>(<generated>)
[exec] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
[exec] at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
[exec] at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)
[exec] at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
[exec] at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:262)
[exec] ... 12 more
_______________________________________________
aspectwerkz-user mailing list
aspectwerkz-user@lists.codehaus.org
http://lists.codehaus.org/mailman/listi ... werkz-user