Hello everyone,
I have an EJB3 (.par) persistence project deployed in a Jboss 4.0.5 GA.
I needs to instantiate the AnswerBean (a remote interface) from a stand alone java application.
My code looks like:
props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); props.put(Context.PROVIDER_URL,"jnp://localhost:1099"); props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); Context ctx = new InitialContext(props); AnswerBean factory = (AnswerBean) ctx.lookup("AnswerBeanRemote");
java.lang.ClassCastException: org.jnp.interfaces.NamingContext cannot be cast to Persistencia.dao.interfaces.AnswerDAO