Hi All
According to the J2ee 1.2 spec, a server object should be getting the initial context using the "no argument constructor" : new InitialContext(). This works fine for a server object. But when it comes to normal java client application(for example a batch program using an EJB), this doesnt work. How do we get the initial context for this kind of clients(running on a different JVM)? Whats the J2ee spec for this situation?
Thanks in advance
-
J2ee spec for JNDI initial context for java clients (6 messages)
- Posted by: Jo V
- Posted on: May 15 2003 10:42 EDT
Threaded Messages (6)
- j2ee client by saji aravind on May 15 2003 14:17 EDT
- j2ee client by Jo V on May 15 2003 14:28 EDT
- J2ee spec for JNDI initial context for java clients by Aaron Robinson on May 19 2003 14:28 EDT
- J2ee spec for JNDI initial context for java clients by Jo V on May 19 2003 17:46 EDT
-
J2ee spec for JNDI initial context for java clients by Aaron Robinson on May 21 2003 09:06 EDT
- J2ee spec for JNDI initial context for java clients by Jo V on May 21 2003 01:23 EDT
-
J2ee spec for JNDI initial context for java clients by Aaron Robinson on May 21 2003 09:06 EDT
- J2ee spec for JNDI initial context for java clients by Jo V on May 19 2003 17:46 EDT
-
j2ee client[ Go to top ]
- Posted by: saji aravind
- Posted on: May 15 2003 14:17 EDT
- in response to Jo V
I dont know what the spec says..( do I care? ). But this is what we use and this is very similar to what WebSphere launchClient uses.
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL,"iiop://192.168.0.1");
ic = new InitialContext(env);
where 192.168.0.1 is the ip address of the JNDI provider(usually same as the appserver) -
j2ee client[ Go to top ]
- Posted by: Jo V
- Posted on: May 15 2003 14:28 EDT
- in response to saji aravind
Thanks Saji. -
J2ee spec for JNDI initial context for java clients[ Go to top ]
- Posted by: Aaron Robinson
- Posted on: May 19 2003 14:28 EDT
- in response to Jo V
Use an application client - see the J2EE spec - this will allow you top use the default initial context and a whole bunch of other goodies -
J2ee spec for JNDI initial context for java clients[ Go to top ]
- Posted by: Jo V
- Posted on: May 19 2003 17:46 EDT
- in response to Aaron Robinson
Thanks Aaron. Could you explain in detail what you meant by "application client"??
Thanks -
J2ee spec for JNDI initial context for java clients[ Go to top ]
- Posted by: Aaron Robinson
- Posted on: May 21 2003 09:06 EDT
- in response to Jo V
Take a look at the J2EE spec, I think it's covered in there. Basically it's a client that is shipped within the ear, and then extracted out at deployment time. POJO clients are not covered by the specs at all, application clients get access to limited container stuff, like default initial context, and I think maybe even UserTransaction. -
J2ee spec for JNDI initial context for java clients[ Go to top ]
- Posted by: Jo V
- Posted on: May 21 2003 13:23 EDT
- in response to Aaron Robinson
Thanks Aaron!