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

    NamingContext cannot be cast to AnswerBean

    efmcuiti

      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");
      


      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

      Thanks