I apologize if this sounds idiotically obvious, but when you mentioned 
your classpath, you didn't list the jar that contains your remote and 
home classes.  It's a long shot since I'd expect a 
ClassNotFoundException instead if that is indeed the problem.

----- Original Message -----
From: Tobias Seelinger <[EMAIL PROTECTED]>
Date: Monday, March 26, 2001 6:24 am
Subject: [JBoss-user] Bean lookup from client

> Hi,
> 
> i have deployed some Beans with JBoss pre 2.1 binary and now I am 
> tryingto connect with a client application. The client code looks 
> like the
> examples from the JBoss website:
> 
> InitialContext jndiContext = new InitialContext();
> Object ref  = jndiContext.lookup("Login");
> LoginHome home = (LoginHome)PortableRemoteObject.narrow (ref,
> LoginHome.class);
> 
> But the third line leads to a ClassCastException for LoginHome. A
> System.out.println for ref shows me "LoginHome", so the JNDI lookup
> succeeded. The superclass for ref is java.lang.reflect.Proxy, so I 
> triedto find out which Interfaces this dynamic Proxy is 
> implementing. It
> implements LoginHome and javax.ejb.Handle.
> Now I can cast ref to Handle but I can't cast ref to LoginHome. That's
> very strange...
> 
> My client classpath contains jboss-client.jar and ejb.jar.
> I have no idea what could be wrong.
> 
> 
> Tobias
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
> 


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to