0 Replies Latest reply on Apr 15, 2002 9:12 AM by Lazzarini

    Servlet problem

    Lazzarini Newbie


      I am using JBoss 3.0.0beta2(200204150942) with Win2k SP2.
      I have a servlet which uses a session bean to perform a call to a findAll method on a CMP 2.x entity bean. In the init method, I have:

      InitialContext jndiContext = new InitialContext();
      Object ref = jndiContext.lookup("ejb/MyBean");
      MyBeanHome home = (MyBeanHome) PortableRemoteObject.narrow(ref, MyBeanHome.class);
      target = home.create();

      I have set the ejb-ref in web.xml and jboss-web.xml.

      When I deploy the ear file under JBoss for the first time, it works fine. But when I redeploy, and then to
      try to connect to the servlet, I get a CCE:

      ERROR [STDERR] java.lang.ClassCastException
      ERROR [STDERR] at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
      ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)

      Is there anything else that needs to be configured ?
      Or is it a bug ?