2011-08-01 15 views
0

我有以下豆設置傳遞一個目錄到一個bean構造

<bean id="server-engine" 
    class="RuleEngineRESJSE"> 
    <constructor-arg index="0" value="package.rulesengine.log" /> 
</bean> 

但是我得到的錯誤:

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

構造簡單地通過一個字符串參數爲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(); 
} 

所以我看到異常被拋出。這會讓我覺得:

this.log = System.getProperty(rulesLogProperty) 

是問題,但爲什麼?

回答

0

一切都看起來正確的給我。我假設package.rulesengine.log只是不在正確的位置,雖然這似乎太簡單了。

相關問題