4 Replies Latest reply on Sep 14, 2007 10:06 AM by Carlo de Wolf

    Returning an EJB from other

    Emilio Francesquini Newbie

      Hi!

      I'd like to return an stateful EJB from another EJB to a client. Nothing new to it, but, I'd like to have it initialized before hand.

      In earlier versions of EJB (as in 2.1) I could do that by declaring a create method with some parameters in a Home interface. Now, in EJB 3.0 I couldn't find a way to do it. I imagine the solution for that is to use the @Init annotation with a inicialization method that receveis some arguments. The problem is that I'm not sure how to make the container call this method because I don't realy know any other way to create an EJB instance other than doing a JNDI lookup in which the container calls the zero argument version of the anottated method.

      Any ideias on how to do it in EJB 3.0?

      tks