0 Replies Latest reply on Mar 13, 2006 1:28 AM by Siva Prasad Reddy

    Unable to connect to MEJB10g ( on oc4j from JBOSS

    Siva Prasad Reddy Newbie

      I am trying to fetch the data from MEJB present in oc4j 10g ( using the following code

      Object obj = null;
      ManagementHome mgmtHome=null;
      Management server = null;
      InitialContext ctx = null;
      Hashtable props = new Hashtable();
      props.put(Context.PROVIDER_URL, "ormi://localhost:23791/default");
      props.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
      props.put(Context.SECURITY_CREDENTIALS, "Password12");
      props.put(Context.INITIAL_CONTEXT_FACTORY ,"com.evermind.server.ApplicationClientInitialContextFactory");
      ctx = new InitialContext(props);
      obj = (ManagementHome) ctx.lookup("java:comp/env/ejb/mgmt/MEJB");
      mgmtHome = (ManagementHome) PortableRemoteObject.narrow(obj, ManagementHome.class);
      server = mgmtHome.create();

      from the servlet in JBOSS4.0.3SP1.
      and i am getting the following Exception

      javax.naming.NoInitialContextException: Cannot instantiate class: com.evermind.server.ApplicationClientInitialContextFactory [Root
      exception is java.lang.ClassNotFoundException: com.evermind.server.ApplicationClientInitialContextFactory]

      I used the same code to connect to to oc4j using the standalone application and it was working fine.

      can anyone give me some solution to this.
      Thanks in advance.