commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Longman" <glong...@intelligentworks.com>
Subject [Hivemind] IllegalAccessError constructing interceptor
Date Tue, 16 Mar 2004 02:44:41 GMT
Having a problem instantiating an Interceptor built in a factory using
ClassFab.

Maybe another set of eyes can see what I'm missing!

Class serviceInterfaceClass = stack.getServiceInterface();

String name = ClassFabUtils.generateClassName("Interceptor");
ClassFab classFab =
    fClassFactory.newClass(name, Interceptor.class,
stack.getServiceModule());
                                                    ^^^^^^^^^^^^ No error
here!

classFab.addInterface(serviceInterfaceClass);
classFab.addField("_inner", serviceInterfaceClass);

... add constructor

classFab.addConstructor(
    new Class[] {
    Log.class,
    SessionLocalManager.class,
    String.class,
    serviceInterfaceClass },
    null,
    "{ super($1, $2, $3); _inner = $4; }");


... add methods, then


Class interceptorClass = classFab.createClass()

Last line, createClass() throws the following exception when
_loader.loadClass(className, bytecode); is called inside it.

java.lang.IllegalAccessError: class $Interceptor_fb5181fe18_9 cannot access
its superclass com.iw.session.local.Interceptor

But of course the factory can see Interceptor.class or I would never have
made it as past
ClassFab classFab =  fClassFactory.newClass(.... at the top of the src
above.

Geoff

Geoffrey Longman
Intelligent Works Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message