- Create a InitialContext and use it
- Create another InitialContext and use that...
- Reuse your first InitialContext
then your last call to reuse your first initial context will use your second initial context.
At least that’s the theory, but it gets even more confusing when one Context uses security and the other doesn’t.
SO, the big idea here is to ALWAYS close your initial context after use:
Context ctx = new InitialContext(props)
For more information take a look at the Weblogic documentation on this