Hi,
I'm reading Head First
EJB and I'm trying to see how first example works. I'm using standard j2ee 1.3 server.
I managed to create my first session bean and even succesfully deploy it.
Now I want to write a simple client application which will connect to J2EE server and run business method of my bean.
I copied application from the book but it does not work. As far as I know there is sth wrong with JNDI configuration.
My client App code looks like:
<code>
try{
Context ic = new InitialContext();
System.out.println("Looking for component " + name);
Object o = ic.lookup(name);
DoradcaHome ibaz = (DoradcaHome)PortableRemoteObject.narrow(o, DoradcaHome.class);
Doradca doradca = ibaz.create();
System.out.println(doradca.getAdvice());
}catch(Exception e) {
e.printStackTrace();
}
</code>
and it throws exception from ic.lookup(name).
As you can see I haven't configured InitialContext in any way - I just don't know how to do it.
Can anyone help?
Thanks in advance