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

    Need to specify class name in environment or system property

    Andrew Iggleden Newbie


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

      any ideas ?