0 Replies Latest reply on Apr 6, 2007 3:02 AM by Edison Mendez

    NamingContext cannot be cast to AnswerBean

    Edison Mendez Newbie

      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.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      Context ctx = new InitialContext(props);
      AnswerBean factory = (AnswerBean) ctx.lookup("AnswerBeanRemote");

      But when i run it... the following exception is printed:

      java.lang.ClassCastException: org.jnp.interfaces.NamingContext cannot be cast to Persistencia.dao.interfaces.AnswerDAO

      Please... help me with this