Last active
February 14, 2016 11:55
-
-
Save dimovelev/e1804c1d5eda6c4c4cfb to your computer and use it in GitHub Desktop.
WebLogic JNDI - Not Closing The Initial Context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@WebService | |
public class FacadeJaxWs implements FacadeWebService { | |
@EJB(lookup = "FrontendEjb") | |
protected FrontendEjbHome frontendEjbHome; | |
public void updateCustomer() { | |
Properties envBackend = new Properties(); | |
envBackend.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); | |
envBackend.put(Context.PROVIDER_URL, "t3://backend:7001"); | |
envBackend.put(Context.SECURITY_PRINCIPAL, "backend_user"); | |
envBackend.put(Context.SECURITY_CREDENTIALS, "backend_password"); | |
Context ctxBackend = new InitialContext(envBackend); | |
BackendEjbHome home = (BackendEjbHome) ctxBackend.lookup("BackendEjb"); | |
BackendEjb remote = home.create(); | |
remote.updateCustomerInBackend(mode); | |
FrontendEjb remote = frontendEjbHome.create(); | |
remote.updateCustomerInFrontend(mode); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment