geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Mulder" <ammul...@alumni.princeton.edu>
Subject Re: help! gbean ref doesn't contain added interfaces
Date Fri, 01 Dec 2006 22:18:18 GMT
Are you sure the GBean in question actually implements the interface?
And that the module builder you're interacting with is definitely
using the implementation class you think it is?  (Maybe you copy and
pasted the GBeanInfo block from old to new GBean and it's referring to
the old class instead of the new class in the GBeanInfo in the new
class?)

Thanks,
      Aaron

On 12/1/06, Sachin Patel <sppatel2@gmail.com> wrote:
> Thanks Aaron.. see inline.
>
>
> On Dec 1, 2006, at 4:20 PM, Aaron Mulder wrote:
>
> So what you get back is ordinarily a proxy to the actual service.  If
> you get the abstract name for the returned module builder (the kernel
> has a call to do that) and then get a fresh proxy to it (from the
> proxy manager from the kernel), does it include your new interface?
>
> Yes, creating a fresh proxy includes the new interface, but unfortunately
> that only gets me passed the class cast, as it throws an exception "No
> implementation method" when calling a method on the interface.  :(
>
> If so, it suggests that the proxies generated for the reference
> include only the interfaces that match the reference type.
>
> Thats what I assumed, but if I changed the reference type to the new
> interface, then for some reason getWebConfigBuilder() returns null, so
> something was still expecting the referenceType for the builders to be
> ModuleBuilder.class.
>
>
> If not, it
> may be that the class loader that's provided to create the proxy
> doesn't include the added interface (though there used to be a warning
> emitted every time this happened).
> I'm not sure what could be done to
> work around that -- maybe either add the interface to other modules as
> needed or contrive to use the right module's class loader to create
> the proxy.
>
> Thanks,
>     Aaron
>
> On 12/1/06, Sachin Patel <sppatel2@gmail.com> wrote:
>
> I'm having some trouble figuring out why I'm getting a ClassCastException
> and would appreciate if someone could shed some light...
>
> In TomcatModuleBuilder I implement an "additional" interface ModuleBuilder2
> as well as add..
>
> static {
> ...
>  infoBuilder.addInterface(ModuleBuilder2.class)
> ...
> }
>
> But then in EARConfigBuilder if I call...
>
> ((ModuleBuilder2) getWebConfigBuilder())
>
> I get a ClassCastException casting it to ModuleBuilder2 during the building
> of the configs which I don't understand why.  If I inspect the interfaces of
> getWebConfigBuilder() it only returns ModuleBuilder and
> GeronimoManagedGBean.  Why isn't ModuleBuilder2 being listed?
>
> I tried updated the referenceType for WebBuilder in EARConfigBuilder from
> ModuleBuilder to ModuleBuilder2, but then in that case getWebConfigBuilder
> ends up returning null.
>
> What am I missing? Why can't I add an additional interface to the
> TomcatModuleBuilder GBean?
>
> Thanks
>
> -sachin
>
>
>
>
> -sachin
>
>

Mime
View raw message