roller的一个错误

roller部署的文档网上很多!我用的版本是4遇到这个问题折腾了半天!记录下来以后方便查看
java.lang.IllegalStateException: Roller Weblogger has not been bootstrapped yet
这个问题出现问题的原因是
网上部署的都说增加这个文件roller-custom.properties
仔细查看一下源代码有个bug
InputStream is = config_class.getResourceAsStream(default_config);
            config.load(is);

            // now, see if we can find our custom config
            InputStream is = config_class.getResourceAsStream(custom_config);
            if(is != null) {
                config.load(is);
                System.out.println("Roller Weblogger: Successfully loaded custom properties file from classpath");
            } else {
                System.out.println("Roller Weblogger: No custom properties file found in classpath");
            }
这样写吧默认的常量都覆盖掉了
解决方法
InputStream is = config_class.getResourceAsStream(default_config);
            config.load(is);

            // now, see if we can find our custom config
            InputStream ist = config_class.getResourceAsStream(custom_config);
            if(ist != null) {
                config.load(ist);
                System.out.println("Roller Weblogger: Successfully loaded custom properties file from classpath");
            } else {
                System.out.println("Roller Weblogger: No custom properties file found in classpath");
            }
仔细看看就知道什么原因了

你可能感兴趣的:(错误)