[jboss-user] [JCA/JBoss] - JCA Adapter ClassCastException

mickey.mouse do-not-reply at jboss.com
Wed Oct 25 10:33:53 EDT 2006


Hello,

I'm writing a JBoss JCA Adapter, and I have a strange ClassCastException in the client EJB code.

Here's the situation (in the EJB)
1. Look up JCA Connection via JNDI - OK.
    Object returned is a ConnectionFactory (store as connFact)
2. Examine ConnectionFactory in debugger
    ConnectionFactory is really my own connection Factory implementation
    (let's call it FooConnectionFactory)
    in debugger, if I evaluate
    (connFact instanceof FooConnectionFactory)
    - answer is TRUE.
3. I now cast connFact to type FooConnectionFactory.
    FooConnectionFactory myConnFact = (FooConnectionFactory)connFact;

  At this point, I get a ClassCastException!
  But this doesn't jive: 
   - in the debugger, connFact is really a FooConnectionFactory. 
   - casting *in the debugger* works too!

Does anyone have any idea on what might be going wrong? An educated guess is some JBoss classloading issue - but it's just a guess.

Any help is really appreciated.

Thanks

    

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980715#3980715

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980715



More information about the jboss-user mailing list