hello
i want to do some initial operation when the session bean is first created,but where my initial code should be?i think it should be "ejbCreate()" method,so that i make the following
test:
the ejbCreate method of my session bean:
public void ejbCreate() throws CreateException {
System.out.println("this is ejbCreate!");
}
then i write a test client by using the jb6 test client wizard,in the test client,i invoke the create() method of the home interface of the session bean,i think that the ejbCreate method should be invoked,but it can't,the code snippet as:
.....................
Context ctx = new InitialContext();
Object ref = ctx.lookup("session");
sessionHomeObject = (sessionHome) PortableRemoteObject.narrow(ref, sessionHome.class)
session s=sessionHomeObject.create();
.........................
.............
when i execute the test client,the
string "this is ejbCreate" can't be printed,but i can call any business method of the session bean in the client,i wonder when the ejbCreate method is executed?how can i do some initialization operation,because the session bean has not the constructor.