Hi all,
I'm developing a cluster environment in JBoss 4.0.2 and I'm getting the ClassCastException in my Servlet while doing the lookup and the code used for the lookup process is given below.
Properties p = new Properties(); p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); p.put(Context.PROVIDER_URL, "jnp://localhost:1099"); Context context = new InitialContext(p); ExampleSLHome exampleSLHome = (ExampleSLHome) context.lookup("ExampleSLHome"); System.out.println("ExampleSLHome ::: " + exampleSLHome); System.out.println("ExampleSLHome Class ::: " + exampleSLHome.getClass());
<session> <ejb-name>ExampleSLBean</ejb-name> <jndi-name>ExampleSLHome</jndi-name> <clustered>true</clustered> </session>