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)
是問題,但爲什麼?