OAS :Invoking an EJB from a client. URGENT!

From: Hugo Lérias <Hugo.Lerias_at_netc.pt>
Date: 2000/08/08
Message-ID: <39907C56.1A1A0E6_at_netc.pt>#1/1


We’re trying to access an EJB from a java application, but when we try to connect to the OAS to get the remote interface of the object we always get a naming exception.

This is the client code we’re experimenting,(see bellow) it’s based on the HelloWorld Example in the Developing Enterprise Java Beans in Oracle 8i.
The deployment into the OAS worked every time with zero problems. So I have no idea what’s happening.
Does anyone have a clue??
I really need some help since I can’t find the problem or someone that knows what I talking about.

Hoping to hear from you,
Hugo


  public static void main(String[] args) {

     // Setup the environment
    Hashtable env = new Hashtable();

    // Turn JNDI on to OAS
      env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "oracle.oas.naming.jndi.RemoteInitCtxFactory");

    try {

      System.out.println("Creating an initial context");
      javax.naming.Context initialContext = new InitialContext(env);

      helloServerHelloHome = (helloHome)
              PortableRemoteObject.narrow(initialContext.lookup(
              "oas://velasques.inesc.pt/HelloOASApp/HelloHome"),
              HelloHome.class);

}

    catch (CommunicationException e) {
      System.out.println("Communication exception! Unable to connect: " + ejbUrl);

      e.printStackTrace();
      System.exit(1);

}

    catch (NamingException e) {
      System.out.println("Naming exception occurred!");
      e.printStackTrace();
      System.exit(1);

}

    // That's it!
  }   Received on Tue Aug 08 2000 - 00:00:00 CEST

Original text of this message