Re: [cglib-devel] IllegalAccessError in fastclass

2006-02-27 Thread Chris Nokleberg
On Tue, 14 Feb 2006 18:16:24 -0800, Jason Dillon wrote:
 I've added definitions for ejbRemove() which call super.ejbRemove() to
 get around this.  Do you know when the fix will make it into a CGLIB
 release that would be usable by G?

CGLIB CVS HEAD has the necessary fixes now. We'll probably cut a release
pretty soon but feel free to build your own jar and test it out.

Chris




Re: [cglib-devel] IllegalAccessError in fastclass

2006-02-14 Thread Dain Sundstrom
I'm copying Geronimo dev on this so, Jason Dillon can respond with  
more specifics.  To get the ball rolling, here is the top of the  
stack trace we are seeing:


java.lang.IllegalAccessError: tried to access class
org.springframework.ejb.support.AbstractEnterpriseBean from class
com.solidusnetworks.paycore.ach.model.merchant.service.MerchantViewServi 
ceBean$$FastClassByCGLIB$$e322b03a
at  
com.solidusnetworks.paycore.ach.model.merchant.service.MerchantViewServi 
ceBean$$FastClassByCGLIB$$e322b03a.invoke(generated)
at org.openejb.dispatch.AbstractMethodOperation.invoke 
(AbstractMethodOperation.java:90)

at org.openejb.slsb.RemoveMethod.execute(RemoveMethod.java:69)
at org.openejb.dispatch.DispatchInterceptor.invoke 
(DispatchInterceptor.java:72)


The target bean is MerchantViewServiceBean and the method we are  
calling is ejbRemote(), which is part of the javax.ejb.SessionBean  
interface.  MerchantViewServiceBean does not have its own ejbRemote 
(), it picks it up from AbstractStatelessSessionBean (from app),  
which picks it up from AbstractStatelessSessionBean (from spring).


-dain

On Feb 14, 2006, at 1:10 PM, Chris Nokleberg wrote:


On Tue, Feb 14, 2006 at 12:31:45PM -0800, Dain Sundstrom wrote:

I'm getting an IllegalAccessError when using fastclass to invoke a
method on an instance where the method is inherited from a parent  
class.


This works in general, so it must be something particular about your
child/parent classes. What is the method declaration, and the
package/access of the respective classes?

Chris



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through  
log files

for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD  
SPLUNK!
http://sel.as-us.falkag.net/sel? 
cmd=lnkkid=103432bid=230486dat=121642

___
cglib-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/cglib-devel




Re: [cglib-devel] IllegalAccessError in fastclass

2006-02-14 Thread Chris Nokleberg
 On Tue, Feb 14, 2006 at 12:31:45PM -0800, Dain Sundstrom wrote:
 I'm getting an IllegalAccessError when using fastclass to invoke a
 method on an instance where the method is inherited from a parent  
 class.

I've reproduced the bug. It is caused because the method is actually
defined in a non-public class in another package: the public class
org.springframework.ejb.support.AbstractStatelessSessionBean extends the
non-public class org.springframework.ejb.support.AbstractSessionBean.
IMHO this is kind of weird on Spring's part, but nonetheless it has
exposed a bug in FastClass, which is calling invokevirtual on the
ancestor class instead of the derived class.

The workaround, as you have discovered, is to redefine the method in the
derived class, even if it is just to call super.ejbRemove().

Some other parts of CVS HEAD are in transition now (the
MethodInterceptor startup optimizations) so even after I fix this bug
you'll have to wait a little while. I'll let you know when there is a
new version to test.

Thanks,
Chris



Re: [cglib-devel] IllegalAccessError in fastclass

2006-02-14 Thread Jason Dillon
Weird... I did not notice that
org.springframework.ejb.support.AbstractSessionBean was package
private.  It makes a little sense that is is package private because
you only expect users to extend from one of its direct subclasses for
MDB or a SB.

Thanks for taking a look :-)

I've added definitions for ejbRemove() which call super.ejbRemove() to
get around this.  Do you know when the fix will make it into a CGLIB
release that would be usable by G?

--jason


On 2/14/06, Chris Nokleberg [EMAIL PROTECTED] wrote:
  On Tue, Feb 14, 2006 at 12:31:45PM -0800, Dain Sundstrom wrote:
  I'm getting an IllegalAccessError when using fastclass to invoke a
  method on an instance where the method is inherited from a parent
  class.

 I've reproduced the bug. It is caused because the method is actually
 defined in a non-public class in another package: the public class
 org.springframework.ejb.support.AbstractStatelessSessionBean extends the
 non-public class org.springframework.ejb.support.AbstractSessionBean.
 IMHO this is kind of weird on Spring's part, but nonetheless it has
 exposed a bug in FastClass, which is calling invokevirtual on the
 ancestor class instead of the derived class.

 The workaround, as you have discovered, is to redefine the method in the
 derived class, even if it is just to call super.ejbRemove().

 Some other parts of CVS HEAD are in transition now (the
 MethodInterceptor startup optimizations) so even after I fix this bug
 you'll have to wait a little while. I'll let you know when there is a
 new version to test.

 Thanks,
 Chris