kolen0909 / gitiles

Automatically exported from code.google.com/p/gitiles
0 stars 0 forks source link

Init param "configPath" of GitilesServlet take no effect #42

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1. Extract the content of gitiles-war-1.0-SNAPSHOT.war file to 
<tomcat_dir>/webapps/gitiles/
2. Edit <tomcat_dir>/webapps/gitiles/WEB-INF/web.xml, change param value of 
init param "configPath" to the path of gitiles config file.
3. Start up tomcat, visit http://<server>:<port>/gitiles/

HTTP 500
javax.servlet.ServletException: gitiles.baseGitUrl not set
    com.google.gitiles.GitilesFilter.getBaseGitUrl(GitilesFilter.java:416)
    com.google.gitiles.GitilesFilter.setDefaultUrls(GitilesFilter.java:333)
    com.google.gitiles.GitilesFilter.setDefaultFields(GitilesFilter.java:301)
    com.google.gitiles.GitilesFilter.init(GitilesFilter.java:198)
    com.google.gitiles.GitilesServlet.init(GitilesServlet.java:73)
        ...

The problem is in com.google.gitiles.GitilesConfig

  public static File defaultFile(FilterConfig filterConfig) {
    String configPath = System.getProperty(PROPERTY_NAME, DEFAULT_PATH);    //configPath will never be null
    if (configPath == null && filterConfig != null) {
      configPath = filterConfig.getInitParameter(FILTER_CONFIG_PARAM);      //this line will never be reached
    }
    return new File(configPath);
  }

Original issue reported on code.google.com by langm...@gmail.com on 27 Feb 2014 at 3:35

GoogleCodeExporter commented 9 years ago
same problem

Original comment by nathen...@gmail.com on 15 Dec 2014 at 4:16