geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Referencing JCA Admin Object
Date Tue, 29 Nov 2005 21:40:53 GMT

On Nov 29, 2005, at 12:00 PM, Richard wrote:

>
> David,
>  
> I got pulled away from this for a few days and came back to it this 
> morning.  I managed to make it work properly provided I deploy my 
> connector as part of my EAR.  Previously, I was deploying the 
> connector separate from the EAR (as a global connector if you will) 
> and the reference was breaking due to some class loader issue.  I'm 
> not sure why, seeing as the classes are in the repository. I kinow 
> this surely works with JMS admin objects as I have tried this 
> successfuly. 

To make the separate deployment work you probably need to make the 
connector configuration a parent of the ear configuration and not get 
the admin object classes in the ear directly.  Otherwise you will 
probably get the same class loaded in two classloaders, which could 
easily cause the problem you are seeing.

Anyway, I'm glad you got it to work :-)

thanks
david jencks

>  
>  
> Richard.
>  
>  
>  
>  
>  
>  
> I've updated ResourceReference to provide more useful information on
>
> the exact cause of error.
>
> thanks
>
> david jencks
>
> On Nov 18, 2005, at 12:18 PM, David Jencks wrote:
>
> >
>
> > On Nov 18, 2005, at 8:52 AM, Richard wrote:
>
> >
>
> >> Thanks again David,
>
> >>  
>
> >> I apologize for not sending the cause the first time.  I scanned the
>
> >> stack too quickly and missed it.  It is below.  For some reson is is
>
> >> complainging my impl class does not realize my interface.  I'm
>
> >> certain it does. Also, I've looked several times to make sure I have
>
> >> not mistyped something.  I am assuming that the classes are all
>
> >> verified at deployment time.  I feel like I am missing something
>
> >> obvious ;-)
>
> >>  
>
> >>  
>
> >> I added some printf's to my impl class and I see the setters getting
>
> >> called.  So I know it is the right type that is added to JNDI.  
> These
>
> >> beans do not need to implement any specific interface do they; as
>
> >> long as they implement the interface I prescribed in my connector I
>
> >> should be good to go.  Any ideas would be greatly appreciated.
>
> >>  
>
> >>  
>
> >> Caused by: java.lang.ClassCastException: Proxy does not implement
>
> >> expected inter
>
> >> face interface com.abc.Interface
>
> >>         at
>
> >> 
> org.apache.geronimo.naming.reference.ResourceReference.getContent(Res
>
> >> ourceReference.java :61)
>
> >>         at
>
> >> 
> org.apache.geronimo.naming.java.ReadOnlyContext.lookup(ReadOnlyContex
>
> >> t.java:220)
>
> >
>
> > I think there are 2 possibilities: one is that there is an error in
>
> > perhaps the ra.xml or the plan and the wrong interface is specified
>
> > somewhere, and the other is that the interface is being loaded twice
>
> > in 2 different classloaders.
>
> >
>
> > Aside from just looking again, if you post the ra.xml and the plan I
>
> > will review them. I think it's more likely that there are 2
>
> > classloaders involved. Is the interface in question in 2 jars, such
>
> > as in the adapter itself and in the ejb jar? I usually find the
>
> > source of these problems by putting a breakpoint at the source of the
>
> > exception and carefully examining the objects and classloaders
>
> > involved. I'll look into adding some more helpful analysis code that
>
> > will provide more useful information.
>
> >
>
> > thanks
>
> > david jencks
>
> >

Mime
View raw message