Thanks Jeanne. I did went through the tutorial. My problem is this line - Context myEnv = Context)initial.lookup("java:comp/env");
What is ths "java:comp/env" ??? I can understand the latter part ejb/jndiname because I know that I am setting that in sun-ejb-jar.xml with reference to my bean.
I have solved my problem actually by using this: InitialContext ic = new InitialContext(); Object homeObj = ic.lookup("corbaname:iiop:1.2@localhost:3700#TheSayMyName");
Well only thing I understand is 3700 the RMI-IIOP port and the JNDI name of my bean "TheSayMyName" as appears in sun-ejb-jar.xml.
But what about the rest? If I would have not found the piece of code from internet then how to know that string?
I am coming across lot of example in the internet where they are first creating a Initial naming context and putting some values (url type) in properties and then suing that properties class to create initial context.