0 Replies Latest reply on Apr 13, 2003 3:16 AM by souchiwang

    help...what 's problem in cmr

    souchiwang

      this is a method in entityBean
      public void addLogin_log(String ip)
      {
      try
      {
      Context ic = new InitialContext(); Login_logHome home = (Login_logHome)ic.lookup("Login_log");
      Login_log log = home.create();
      log.setIp(ip);
      getLogin_logs().add(log); }catch(Exception e)
      {
      System.out.println(e);
      }

      }


      client...
      Context ctx = new InitialContext();
      CustomerHome home = (CustomerHome)ctx.lookup("Customer");
      Customer art = home.findByPrimaryKey("iman");
      art.setPwd("sou");

      art.addLogin_log("140.135.11.30");

      exception...
      java.lang.IllegalArgumentException: Object must be an instance of iman.login_log.interfaces.Login_logLocal, but is an isntance of [i
      man.login_log.interfaces.Login_log],,,
      i know my probelm ...because i use the no-local...
      but when i use local in entityBean..
      .code...
      Context ic = new InitialContext();
      Login_logLocalHome home = (Login_logLocalHome)ic.lookup("Login_log");
      Login_logLocal loc = home.create();
      getLogin_logs().add(log);
      ....
      there are exception ..
      ClassCastException...
      jboss.xml..

      <enterprise-beans>

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



      <ejb-name>Login_log</ejb-name>
      <jndi-name>Login_log</jndi-name>

      </enterprise-beans>

      please help me