Looking at one more place (#1314)

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7728 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-03-14 05:42:23 +00:00
1 parent 37f082e896
commit 35362e9dab
1 file changed
+6 -1
+6 -1
View File
@@ -226,10 +226,15 @@ public class WebAppMain implements ServletContextListener {
private File getHomeDir(ServletContextEvent event) {
// check JNDI for the home directory first
try {
Context env = (Context) new InitialContext().lookup("java:comp/env");
InitialContext iniCtxt = new InitialContext();
Context env = (Context) iniCtxt.lookup("java:comp/env");
String value = (String) env.lookup("HUDSON_HOME");
if(value!=null && value.trim().length()>0)
return new File(value.trim());
// look at one more place. See issue #1314
value = (String) iniCtxt.lookup("HUDSON_HOME");
if(value!=null && value.trim().length()>0)
return new File(value.trim());
} catch (NamingException e) {
// ignore
}