HI - I'm new to JBoss and just trying a simple servlet to remote session bean 
lookup.  I keep getting a ClasscastExcepion on the narrow().   

I have a simple EJB - MyBean.class, the remote is My.class, the home is 
MyHome.class.   Here is the servlet lookup code (I try it with and w/o EJB 
referneces, the result is the same):
          __________________________________
InitialContext context = new InitialContext();
Object ref = context.lookup("java:comp/env/ejb/My"); // w/ ref
//Object ref = context.lookup("ejb/My");  // w/o ref
home = (MyHome) PortableRemoteObject.narrow(ref, MyHome.class);
my = home.create();
        ______________________________________

The lookup returns a object named $Proxy51.  The JMX-Console JNDI-view looks 
like this: 

  +- ejb (class: org.jnp.interfaces.NamingContext)
  |   +- My (proxy: $Proxy51 implements interface 
com.blackdog.interfaces.MyHome,interface javax.ejb.Handle)

There is no other MyHome class in the app that it could be confused with.

    This looks like it should work to me.    Can anyone suggest what may be 
going wrong?   Thx.


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

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


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to