This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Welcome to JavaRanch. We don't have many rules here, but we do have a naming policy that is presented to users upon registration and which we try to strictly enforce. Please re-read this document and edit your display name accordingly.
As for your question, what kind of errors are you getting?
As your Action cannot be an application client, I would expect environment properties (in a Hashtable) to be passed into the constructor of InitialContext. Check your EJB container's documentation for what you need to do.
Object not found in lookup, the entire lookup is ejb/facade.
The problem persists even with lookups that specify java:comp/env/ejb/facade or java:/ejb/facade.
The problem goes away if I use the runtime JNDI assigned by the server from NetWeaver's visual admin tool.
My questions are:
1. If I add the target bean to web.xml, can I still not use the reference name to lookup the object from the struts controller (actionclass)?
2. If not, the java:comp/env/ lookup cannot ever be used from a struts controller? I will have to stick with the runtime JNDI assignment made by the EJB container to the bean? This would cause obvious problems since the JNDI has to be hard-coded within the actionclass, not to mention maintenance if my application has to be ported on a different app server.
Roger: I have not passed initialcontext() parameters, but I can access the facade bean using direct JNDI lookup.
Any insights/corrections will be appreciated. [ July 04, 2005: Message edited by: Radhakrishnan Iyyengar ]