I figured it out... as far as the references and reference types I wasn't doing anything wrong, the problem was specific to me updating the Tomcat/Jetty Module Builders and that the SwitchingModuleBuilder needed to be updated as well. thx. On Dec 2, 2006, at 3:59 AM, David Jencks wrote: > I might be misunderstanding what you are trying to do.... > > When you have a gbean reference, you have to declare the interface > you are going to use in the GBeanReferenceInfo you set up in that > static block of code. You'll get a proxy implementing exactly that > interface and nothing else AFAIK. So if you want to use 2 > interfaces that a gbean implements, and neither extends the other, > you need 2 references. > > You might be able to declare the "interface" to be the gbean class > itself (as long as it has a no-arg constructor) and then you should > get a proxy implementing everything in the gbean itself. Be sure > not to have any public final methods in the gbean if you do this. > > Hope this helps > david jencks > > On Dec 1, 2006, at 7:31 PM, Sachin Patel wrote: > >> Yep, the GBean does implement the interface, and the GBean isn't a >> new GBean, I just modified an existing GBean with an additional >> interface. >> >> On Dec 1, 2006, at 5:18 PM, Aaron Mulder wrote: >> >>> 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 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 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 >>>> >>>> >> >> >> -sachin >> >> > -sachin