Search code examples
jndi

Converted JNDI name [java:comp/env/cloudenv] not found


I am getting below error message when I deploy application into Tomcat 7.

2016-02-11 11:52:30,200 DEBUG (localhost-startStop-1) [org.springframework.jndi.JndiLocatorDelegate] Converted JNDI name [java:comp/env/cloudenv] not found - trying original name [cloudenv]. javax.naming.NameNotFoundException: Name [cloudenv] is not bound in this Context. Unable to find [cloudenv].

I would like to know from where "cloudenv" is mention in the application. I could not find such string my application. I also could not find "java:comp/env/" string in my application. Please me know what am I missing to understand the above error.


Solution

  • Let me answer my own question!!! It is due to that I am using dynamic variable in application context. It is trying to search from 5 areas:-

    [servletConfigInitParams]
    [servletContextInitParams]
    [jndiProperties]
    [systemProperties]
    [systemEnvironment]
    

    For jndi, the default search variable is "java:comp/env/" + ${dynamic variable}