When I create a Thread in the init() method of a servlet, within that thread's code I'm still in the web container/JVM, right ? or has it the same effect as if I'd code in a standalone java application ?
if the latter is true, would it be appropriate to create a stub in the init() method of the servlet and pass it to the thread after its creation ? I mean is it ok to cache a local ejb reference / stub ?
I post this, just in case someone needs an answer to this.
We can't call InitialContext() within a thread created inside a servlet container and expect it to be initialized with the parameters passed to a InitialContext() instance created by the server process.
What I did, was simply creating an InitialContext instance and pass it to the thread.