5 Replies Latest reply on Sep 5, 2005 6:43 AM by darranl

    Need to specify class name in environment or system property

    andrewi

      hi

      when i try running the client i get

      Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
      at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
      at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
      at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at org.meerkat.fraud.client.Client.main(Client.java:12)

      the client source is

      package org.meerkat.fraud.client;

      import javax.naming.InitialContext;

      import org.meerkat.fraud.ejb.JFraud;

      public class Client
      {
      public static void main(String[] args) throws Exception
      {
      InitialContext ctx = new InitialContext();
      JFraud test = (JFraud) ctx.lookup(JFraud.class.getName());
      System.out.println("Creating 1");
      test.addCustomer("Andrews Place", "Andrew" );
      System.out.println("Done");
      }
      }

      any ideas ?

      tia
      Andrew