4 Replies Latest reply on Apr 5, 2004 6:56 AM by gunzip

    EJB - java.lang.ClassCastException - newbie

    gunzip Newbie

      I develop the ejb and it deploys ok
      on it there is
      Bean class
      Remote class
      Home class
      jboss.xml(all in an JAR)
      servlet(in an WAR)
      (it doesnt have manifests nor jndi.properties, because i dont know if they are necessary or how to make them)then I pack everything in an EAR, it deploys ok, the servelet works

      but the problem is that when it tries to

      javax.naming.InitialContext jndiContext = new javax.naming.InitialContext();
      System.out.println("Got context");
      java.lang.Object reference = jndiContext.lookup("helloejb/HelloEJB");
      System.out.println("Got reference");
      HelloHome helloejbhome;
      helloejbhome = (HelloHome) javax.rmi.PortableRemoteObject.narrow(reference, org.jboss.helloejb.HelloHome.class);

      it gives me an error on the last line(i receive the last two got messages but then error)
      I'm made the ant set lib with jbossall-client.jar

      Im confused about EJB and Servlet integration, so I've put them ALL on the same folder and package, but still dont work

      my ejb-jar.xml
      JBoss Demo Application
      <display-name>EJB HelloWorld Demo</display-name>






      I'm using red hat 9, Jedit