Hi,
I need a context in my session bean to retrieve other beans in the container:
I coded my bean as I learned here and everything seems work until the passivation
public getRefBean(){
try{
Context jndiContext = new InitialContext();
Object obj = jndiContext.lookUp("...");
}catch(Exception ex){}
}
After the bean has been passivated/re-activated
my method above receive an empty context without my referenced bean!
So I tried to initialize the context only once,
I read somewhere the J2EE rules about the "jndiContext" in a statefull sessionbean: make it a public attribute, initialize it once e forget it!
The container should manage the passivation even if the InitialContext class is not serializable! But with JBoss this doesn't happen!
Can someone help me?
Thanks
PS: please don't laugh about my english!