Sagar Shroff wrote:Yeah i am using Tomcat . And i am aware that tomcat is not an ejb compliant app server.But i thought that ejb annotation was simply an abstract way of doing a JNDI (nothing Ejb specific) , the reason i thought so was because at the end of the day my servlet is going to be deployed in a Web container , so it is going to be managed by a Web container , so i thought that ejb complaint or not being ejb compliant wont make difference.
even if you used JNDI to do lookup then also you wouldn't have got the reference to the bean. the reason is what Fritz pointed. there is no EJB CONTAINER. in other words there is no deploytime or runtime environment in which ejb's run. there wont be logical namespaces (java:app,java:module,java:global) available for the ejb since all this environment is provided by the ejb container.
gurpeet singh wrote:when you do jndi lookup from your SE client then you are actually connecting to the naming service of your container and then lookup names from there. you specify the connection properties through the jndi environment and then use container-specific implementation of global jndi names(which are not portable; also I am not sure I have read about portable global jndi names which are new feature of ejb 3.1 that allows to do lookup in a portable manner).