the problem I am facing is that when I move across environment the location of my JNDI server used to lookup up the EJBs change so I have to keep re-waring the ear file across different environments. Is there any way to configure the JNDI server name so that I get the appropriate JNDI server depending on the environment.
I am using WSAD...and I think the problem can be solved by setting up an name/value environment variable in WSAD BUT is there any api that I can read the environment variable out in my servlet/portlet??
Don't specify the server name when you create the InitialContext. Use the default InitialContext (e.g. just use new InitialContext()) and the local JNDI server in any machine will be picked up automatically.