3 Replies Latest reply on Jul 11, 2002 11:46 AM by Horia Muntean

    Jboss Error

    Reba Newbie

      I get this error whenever I try to run my (client) HelloClient.class file using Jboss 3.0 final

      javax.naming.NoInitialContextException: Cannotinstantiateclass:org.jnp.interfaces.NamingContextFactory
      [Root exception is java.lang.ClassNotFoundException: o
      rg.jnp.interfaces.NamingContextFactory]


      Any idea what might be causing this error and how to get rid of ?
      ==============
      The code for HelloClient.java is
      import javax.naming.*;
      import javax.ejb.*;
      import java.rmi.*;
      import javax.rmi.*;

      public class HelloClient {

      public static void main(String[] args) {
      try {
      InitialContext ict= new InitialContext();
      Object obj= ict.lookup("Hello");

      HelloHome home= (HelloHome)
      PortableRemoteObject.narrow(obj, HelloHome.class);

      Hello hello= home.create();
      hello.sayHello();
      System.out.println(hello.getInfo());
      }
      catch(Exception ex){
      System.out.println(ex);
      }
      }

      }

        • 1. Re: Jboss Error
          Greg Turner Apprentice

          You need to have the required jar files in your class path. For client programs, these can be found in the client library of jboss.

          • 2. Re: Jboss Error
            Reba Newbie

            Thanks .
            Now i am getting anew error running my client class
            The error is:-

            Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/security/SecurityAssociation
            at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:72)
            at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:185)
            at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
            at $Proxy0.create(Unknown Source)
            at HelloClient.main(HelloClient.java:18)
            How do i get rid of this ?

            • 3. Re: Jboss Error
              Horia Muntean Newbie

              In order to access the jboss server u need some jboss jars in your classpath. to be sure put all the jars from ${jboss}/client/ in your classpath (u don't really need the all)