开发者

Passing a dir into a bean constructor

I have the following bean setup

    <bean id="server-engine"
 开发者_高级运维   class="RuleEngineRESJSE">
    <constructor-arg index="0" value="package.rulesengine.log" />
</bean> 

However I get the error:

Constructor threw exception; nested exception is java.lang.IllegalStateException: The value of rulesLogProperty was not found

The constructor simply takes a string argument for the rulesLogProperty

    public RuleEngineRESJSE(String rulesLogProperty) throws IOException {

    if(rulesLogProperty == null)
        throw new IllegalStateException("The rulesLogProperty value is expected");

    this.log = System.getProperty(rulesLogProperty);

    if(log == null)
        throw new IllegalStateException("The value of rulesLogProperty was not found");

    init();
}

so I see the exception is being thrown. which would make me think that:

this.log = System.getProperty(rulesLogProperty)

is the issue but why?


Everything looks set up right to me. I'd assume that the package.rulesengine.log just isn't in the right location although that seems too simple.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜