2 Replies Latest reply on Jun 24, 2002 6:15 AM by Sameer Menon

    Exception in thread "main" java.lang.NoClassDefFoundError: j

    Sameer Menon Newbie

      The client files are in the /home/ejbclients/ directory

      I am getting Error on running this client file. The server files were deployed successfully in jboss-3.0.0 + tomcat-4.0.3 combined binary installation.

      java -Djava.security.policy=hello.policy -classpath /home/ejbclients/jnp-client.jar:/home/ejbclients/HelloHome.class:/home/ejbclients/ HelloClient

      import javax.naming.Context;
      import javax.naming.InitialContext;
      import java.util.Properties;

      public class HelloClient {

      public static void main(String[] args) {

      try {

      System.setSecurityManager(new java.rmi.RMISecurityManager());
      Properties props = new Properties();
      props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      props.put(Context.PROVIDER_URL, "localhost:1099");
      InitialContext ctx = new InitialContext(props);

      //Object obj = ctx.lookup("ejb/Hello");
      // HelloHome home = (HelloHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);

      }
      catch (Exception e) {
      System.out.print("error--"+e.toString());
      }

      }

      }


      the error i get is : ----

      Exception in thread "main" java.lang.NoClassDefFoundError: javax/net/SocketFactory
      at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:38)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:665)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
      at javax.naming.InitialContext.init(InitialContext.java:222)
      at javax.naming.InitialContext.(InitialContext.java:198)
      at HelloClient.main(HelloClient.java:34)