1 Reply Latest reply on Dec 20, 2004 7:32 AM by Darran Lofthouse

    ClassCastException

    Naveen Naveen Newbie

      I have written a simple CMP Entity Bean,While Running the Client I am getting the Exception,I have included all jars needed.


      i am in start
      err in StudentHomejava.lang.ClassCastException
      i am in end


      my client code is


      import javax.ejb.*;
      import javax.naming.*;
      import java.rmi.*;
      import javax.rmi.*;
      import java.util.*;

      import student.student1.*;

      public class StudentClient
      {
      public static void main(String args[])
      {
      System.out.println("i am in start");
      StudentHome home= null;
      try{
      System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      System.setProperty("java.naming.provider.url", "localhost:1099");
      Context context = new InitialContext();
      try{
      home = (StudentHome)PortableRemoteObject.narrow(context.lookup("Student"), StudentHome.class);
      }catch(Exception e){System.out.println("err in StudentHome"+e);}
      /* try{
      home.create("Ammamn","A01");
      }catch(Exception e){System.out.println("err in HomeCreate"+e);}*/
      }catch(Exception e){System.out.println("error in client"+e);}

      System.out.println("i am in end");
      }

      }


      The error is the place where i am casting.(different font)

      can anybody clear it.

      thanx

      NaveenBabu.A