-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: bytecode enhancing tools
PostPosted: Thu Apr 08, 2004 4:26 am 
Newbie

Joined: Sun Dec 28, 2003 4:35 pm
Posts: 13
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 08, 2004 7:51 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Post your question to the CGLIB mailing list they maight have some clue
http://cglib.sourceforge.net/

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 7:34 pm 
Beginner
Beginner

Joined: Fri Aug 29, 2003 3:39 pm
Posts: 33
Location: San Francisco, CA
FWIW, I think this is a bug in AspectWerkz, but not a fundamental incompatibility. CGLIB may make things "harder" for some bytecode-manipulating code since the bytecode generated does not always look like that produced by javac. I'm sure the kinks will get worked out in short order, though.

Chris


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.