blob: b6c516fbd9fc5eb4844b5117209b4f3af91b080e [file] [log] [blame]
= WebLogic Lookup
:index-group: Tips and Tricks
:jbake-date: 2018-12-05
:jbake-type: page
:jbake-status: published
How to lookup WebLogic Objects from within a TomEE context:
[source,java]
----
Hashtable<String, String> props = new Hashtable<String, String>();
props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
props.put(javax.naming.Context.URL_PKG_PREFIXES, "weblogic.jndi.factories");
props.put("java.naming.provider.url", "t3://your.host.name:7023");
Context ctx = new InitialContext(props);
IService s = (IService) ctx.lookup("java:global.com.test.ServiceImpl!com.test.IService");
----
Obviously you will need to change the actual lookup to your specific
object, but you get the idea.