1 Reply Latest reply on Apr 23, 2003 10:32 PM by nickman

    help,,!!!help

    souchiwang

      Context ctx = new InitialContext();
      CustomerLocalHome home = (CustomerLocalHome) PortableRemoteObject.narrow(ctx.lookup("Customer"), CustomerLocalHome.class);
      CustomerLocal art = home.create("iman");

      there are exception:
      java.lang.ClassCastException

      what's problem are there?

      jboss.xml

      <enterprise-beans>

      <ejb-name>Customer</ejb-name>
      <jndi-name>Customer</jndi-name>

      </enterprise-beans>

        • 1. Re: help,,!!!help

          I cannot see all your code or descriptors, but here is what I think may be going on:
          <jndi-name>Customer</jndi-name> is the tag for the remote home. <local-jndi-name>Customer</local-jndi-name> would bve the correct tag name for the local home. So the class cast exception may be because you are casting a remote to a local.
          Try replacing the tags as above.