Which way should we call InitalContext now?
According to this file
http://docs.jboss.org/ejb3/embedded/embedded-tutorial/embedded-war/src/EmbeddedEJB3.jsp
it looks like it can be called both ways.
Way #1:
| InitialContext ctx = getInitialContext();
| CustomerDAOLocal local = (CustomerDAOLocal)
ctx.lookup(CustomerDAOLocal.class.getName());
|
Way#2:
| Queue queue = (Queue) getInitialContext().lookup("queue/mdbtest");
|
| public static InitialContext getInitialContext() throws Exception
| {
| Hashtable props = getInitialContextProperties();
| return new InitialContext(props);
| }
|
| private static Hashtable getInitialContextProperties()
| {
| Hashtable props = new Hashtable();
| props.put("java.naming.factory.initial",
"org.jnp.interfaces.LocalOnlyContextFactory");
| props.put("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
| return props;
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3920653#3920653
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3920653
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user