Hi EveryOne,
When I'm trying to look up the Local EJB through a Servlet and I'm getting the java.lang.ClassCastException.
Here is my Client Code
try { Context context = new InitialContext(); Object object = context.lookup("LoginSLHome"); logger.info("Object ::: "+object.getClass().getName()); LoginSLHome home = (LoginSLHome) object; } catch (Exception exception) { logger.error("Exception while locating Home Object: "); logger.error(exception); }
Object ::: $Proxy128
<session> <ejb-name>LoginSLEJB</ejb-name> <local-jndi-name>LoginSLHome</local-jndi-name> </session>
<session> <ejb-name>LoginSLEJB</ejb-name> <local-home>beans.LoginSLHome</local-home> <local>beans.LoginSL</local> <ejb-class>beans.LoginSLBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> </session>
Your missing the object factory classes from the classpath of the client. jbossall-client.jar for example.