props.list(System.out); //props capture System properties + more
Context initial = new InitialContext ( props );
Object objref = initial.lookup (obj);
As you see, I'm printing out all of my properties, using Properties.list() and
I do see following in my command window:
INITIAL_CONTEXT_FACTORY=weblogic.jndi.WLInitialContextFactory
PROVIDER_URL=t3://localhost:7001
Which means I've everything, I needed for the JNDI lookup but
get following exceptions:
javax.naming.NoInitialContextException: Need to specify class name in environment
or system property, or as an applet parameter, or in an application resource file:
java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:643)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:283)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.brokatfs.EjbClient.callEjb(EjbClient.java:237)
at com.brokatfs.util.ExtractUBData.main(ExtractUBData.java:52)
Could not feed user billing data, reason: NamingException
Take a look at any of the WLS EJB examples.
-- Rob