試圖連接到使用Redisson ...簡單的東西Redis的(在泊塢窗)..Redisson.create與拋出:IllegalArgumentException失敗:主機名不能爲空
Config config = new Config(); config.useSingleServer().setAddress("redis://192.168.99.100:6379"); RedissonClient redisson = Redisson.create(config);
//線3
但我得到這個錯誤(在第3行) - 我錯過了什麼?
Exception in thread "main" java.lang.IllegalArgumentException: hostname can't be null at java.net.InetSocketAddress.checkHost(InetSocketAddress.java:149) at java.net.InetSocketAddress.<init>(InetSocketAddress.java:216) at org.redisson.client.RedisClient.<init>(RedisClient.java:105) at org.redisson.connection.MasterSlaveConnectionManager.createClient(MasterSlaveConnectionManager.java:326) at org.redisson.connection.MasterSlaveConnectionManager.createClient(MasterSlaveConnectionManager.java:314) at org.redisson.connection.SingleEntry.setupMasterEntry(SingleEntry.java:47) at org.redisson.connection.MasterSlaveConnectionManager.initEntry(MasterSlaveConnectionManager.java:263) at org.redisson.connection.MasterSlaveConnectionManager.init(MasterSlaveConnectionManager.java:231) at org.redisson.connection.MasterSlaveConnectionManager.<init>(MasterSlaveConnectionManager.java:159) at org.redisson.connection.SingleConnectionManager.<init>(SingleConnectionManager.java:48) at org.redisson.config.ConfigSupport.createConnectionManager(ConfigSupport.java:168) at org.redisson.Redisson.<init>(Redisson.java:111) at org.redisson.Redisson.create(Redisson.java:151)
你可以接受你的答案。 – LuFFy