3 Replies Latest reply on Nov 9, 2006 3:02 PM by F B

    Writting ejb3 session bean + howto session bean lookup?

    F B Newbie

      There is a web service (stateless session bean with annotations) that needs to call another session bean with annotations.

      1. do ejb3 session beans need to have local/remote interfaces like ejb1.4?
      2. how can sessionbean1 lookup sessionbean2? The below code results in an exception that sessionbean2 is not registered. The logs and JMX console say that sessionbean2 was published with name=sessionbean2 This is jboss 4.0.4

       try {
       context = new InitialContext();
       retVal = (sessionbean2LocalInterface)
       context.lookup("sessionbean2");
       } catch (NamingException e) {
       e.printStackTrace();
       throw new RuntimeException(e);
       }