Trace life cycle of stateless session bean using application client

I have created a very simple stateless session bean to understand the life cycle. but the j2ee verbose console does not display anything, when i invoke the create method from my application client.

j2ee console says "Application LifeCycle deployed"

Thru the second console when i run "java LifeCycleClient", there is no response on the server console. The second console reaches the prompt after executing the client.

BEAN CLASS

import javax.ejb.*;

public class LifeCycle implements SessionBean

{

public String hello()

{ return "hello";}

public void setSessionContext(SessionContext sc) {}

public void ejbActivate() { System.out.println("activated");}

public void ejbPassivate() { System.out.println("passivated");}

public void ejbRemove() {System.out.println("removed");}

public void ejbCreate() { System.out.println("created");}

}

HOME INTERFACE CLASS

import javax.ejb.*;

import java.rmi.*;

public interface LifeCycleHome extends EJBHome

{

public LifeCycleObject create() throws CreateException, RemoteException;

}

REMOTEINTERFACE CLASS

import javax.ejb.*;

import java.rmi.*;

public interface LifeCycleObject extends EJBObject

{

public String hello() throws RemoteException;

}

APLLICATION CLIENT class

import javax.naming.*;

import javax.rmi.*;

public class LifeCycleClient

{

public static void main(String[] ss)

{

try {

Context c = new InitialContext();

Object o = c.lookup("LifeCycleJndi");

LifeCycleHome home=(LifeCycleHome) PortableRemoteObject.narrow(o, LifeCycleHome.class);

LifeCycleObject lco = home.create();

lco.hello();

lco.remove();

}

catch(Exception e)

{}

}

}

[1864 byte] By [J2EE-Learnera] at [2007-10-3 5:25:49]
# 1

The stateless session bean instance lifecycle is not necessarily tied to the client create() method.

The ejb container can use any available stateless session bean instance for any business

method invocation on the bean, so many containers wait until the first business method invocation

to create an instance.

--ken

ksaksa at 2007-7-14 23:33:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...