geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siraj Mohamed" <>
Subject EJB JNDI lookup
Date Wed, 23 Nov 2005 10:34:52 GMT
Hi All,
I have deployed a hello world application (helloworld.ear) on Geronimo
1.0 M5. I have written a java client class to test my application. But I
am getting following error message from the client code:
NamingException: Need to specify class name in environment or system
property, or as an applet parameter, or in an application resource file:
It tells that I have to set java.naming.factory.initial and
java.naming.provider.url in the What would be the
values to be specified for them for Geronimo server?
This is my sample client code:
 * A simple client for accessing an EJB.
public class HelloClient
  public static void main(String[] args)
    System.out.println("client started...");
    try {
      javax.naming.Context ctx = new javax.naming.InitialContext();
      // This is for use with
      System.out.println("looking up...");
      Object homeObject = ctx.lookup("java:comp/env/HelloBean");
      // Narrow the reference to HelloHome
      HelloHome home =
            (HelloHome) PortableRemoteObject.narrow(homeObject,
      // Create remote object and narrow the reference to Hello.
      Hello remote =
            (Hello) PortableRemoteObject.narrow(home.create(),
      System.out.println(remote.sayHello("James Earl"));
    } catch(NamingException e) {
      System.err.println("NamingException: " + e.getMessage());
    } catch(RemoteException e) {
      System.err.println("RemoteException: " + e.getMessage());
    } catch(CreateException e) {
      System.err.println("FinderException: " + e.getMessage());
Thanks in advance,

View raw message