Hi Mattias,

I think I have given some information regarding this section. Anyway this a more detailed description about lookup string "java:comp/env/ejb/MyTest".

This string is composed of two parts as I described, "java:comp/env" and "ejb/MyTest". I have used "ejb/MyTest" since it is a best practice to give names to EJBs and it comes from your web.xml file. It says MyTest name is under the tree of ejb directory. "java:comp/env" part comes from the Geronimo server itself. "MyTest" name deployed in ejb directory which is under env. This env is the short form of environment. "java:comp" is the root context of the name space. "comp" means components.

I hope this will help you.

Regards,
Lasantha Ranaweera
Mattias Malmgren wrote:
Hi again!

Lasantha, I would also like to here your comment about the lookup string!

Best regards / Mattias

In the servlet I use
Object objref = initial.lookup("java:comp/env/ejb/MyTest");
I guess that "java:comp/env/ejb/MyTest" is some sort of URL that the container will use to return the right object (in this case an interface). Now, what are the rules of the lookup-string? In a normal web-url eg. http://www.freefarm.se/foo/bar/test.html the http:// part is the protocol, <http://www.freefarm.se/>www.freefarm.se is the domain, foo/bar corresponds to directories and test.html is the file to ret rive and show in the users browser. But what is "java:" in java:comp/env/ejb/MyTest?? What is env/ejb?? Is that supposed to correspond to something we have put in one of the different xml files? Or is it part of the package com.test.ejb ? MyTest is probably the name of the remote interface. But why the name of the remote interface, why not the name of the




Reply via email to