I’m running an EJB3.0 application on a unix machine and a Weblogic 10.3.4.
I’ve configured a security realm with an SQLProvider which connects to an Oracle DB.
In the domain, we have two providers: The weblogic default provider and a costome provider we created.
After the login, I add to each user’s subject two costume principles.
Here comes the problem: After I’ve logged in into the application, at seemingly random times the costume principles I’ve added vanish from the subject, and the user that connected via my costume provider also vanishes, and returns to the default weblogic user.
Even weirder, sometime (again, at seemingly random times) the costume principles and the loggen in user returns to the subject, without any action from the user (no re-login, for example).
The costume prniciples are crucial to my application.
Why is this happening? How can i solve this?
Thanks in advance for any help!
I figured out the problem – Apparently, in weblogic, Contexts are bound to thread. In my application I use a SwingWorker to execute calls to the server (in an interceptor). SwingWorker has a threadpool, so sometimes the threads in the pool were not assigned a context and the call failed.