我試圖從JNDI讀取定位器主機和端口信息,其值爲格式host [port],host2 [port2]。Spring Data Gemfire - 從JNDI讀取定位器
<jee:jndi-lookup id="locatorsJndi" jndi-name="locators/locator1" />
<gfe:pool id="locatorPool" locators="#{locatorsJndi}">
看來Spring Data gemfire在這種情況下無法正確識別定位器。它將JNDI查找的值字符串作爲一個主機並在末尾添加端口10334。
Unable to connect to any locators in the list [**host[10334],host2[10334]**:10334]; nested exception is com.gemstone.gemfire.cache.client.NoAvailableLocatorsException:
但是,如果我傳遞主機和端口值作爲locators屬性的一部分,如下所示,它按預期工作。
<gfe:pool id="locatorPool" locators="host1[port1],host2[port2]">
這是Spring Data Gemfire中的一個問題嗎?
感謝John的快速回復。我嘗試了你的工作。我現在正在跟蹤錯誤。它沒有說明爲什麼它無法創建locatorPool。引起:java.lang.IllegalStateException:連接池「locatorPool」尚未創建。 – nageshb20
嗨@ nagesh20-你可以更新你的貼子並粘貼新的例外嗎?我給你的代碼片段應該沒有發生任何事情。 –
只是一個更新......我解決了/完成了SGF-535(https://jira.spring.io/browse/SGF-535)。此外,SD團隊明天將發佈SDG 1.7.6.RELEASE(Gosling SR6)和SDG 1.8.4.RELEASE(Hopper SR4),並且SGF-535的更改將在這些版本中發佈。希望你使用的是1.7.x或1.8.x.如果不是,我建議您升級給定SDG 1.6和更早版本不再受支持。如果您有其他問題或意見,請告訴我。乾杯! –