Hi friends:
Actually i'm working with an IBM WebSphere Application Server on
Windows NT. I already had deployed entity beans and session beans
in an
EJB container. In my
servlets I used them without troubles.
But when i tried to call them in a
Java application (within Visual Age for Java) i got this error message :
Uncaught exception java.lang.NoClassDefFoundError: javax.naming.InitialContext
This is my application code :
import java.rmi.*;
import java.util.*;
import javax.ejb.*;
import javax.naming.*;
class HelloClient {
public HelloClient() {
super();
}
public static void main(java.lang.String[] args) {
try {
Properties props = new Properties();
props.put(Context.PROVIDER_URL,"iiop:///");props.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
Context ctx = new InitialContext(props);
HelloHome home = (HelloHome) ctx.lookup("com/wiley/compbooks/ecommerce/Hello");
Hello hello = home.create();
System.out.println(hello.hello());
hello.remove();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Thanks for your help
Jorge