Hi,
I am trying to write my first Stateless session bean...
i have written the approp interfaces and the bean class and deployed the ear successfully
i have written the following code but am getting the same exception that u were getting
"Exception in
thread "main" javax.naming.NoInitialContextException"
could uu please suggest me some solution!!!
here's the Client Code
package examples;
import java.util.Properties ;
import javax.naming.Context ;
import javax.naming.InitialContext ;
public class HelloClient {
public static void main(
String [] args ) throws Exception {
Properties h = new Properties();
h.put( Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.ns.jndi.WsnInitialContextFactory" ) ;
h.put( Context.PROVIDER_URL, "iiop:///" ) ;
Context ctx = new InitialContext(h) ;
Object obj = ctx.lookup( "HelloWorld") ;
HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow( obj, HelloHome.class ) ;
Hello hello = home.create() ;
System.out.println( "Output from
EJB: " + hello.hello() ) ;
hello.remove() ;
}
}
Thanx & Regards,
Priyank Patwa.
Cognizant Technology Solutions India Pvt. Ltd.
Infotech Park,
Hinjawadi,
Pune 411027,
India.
Ph. 2931100 extn: 2476