2016-11-20 41 views
0

我試圖在虛擬箱運行我春季啓動應用包括MongoDB的 & Redis的服務器但與得到錯誤的Redis,因此無法完成得到錯誤在process..I我得到這些錯誤上運行虛擬盒WAR當春天引導應用程序

vb-be7e6bc7 -> Caused by: org.springframework.data.redis.RedisConnectionFailureE 
xception: Cannot get Jedis connection; nested exception is redis.clients.jedis.e 
xceptions.JedisConnectionException: Could not get a resource from the pool 
vb-be7e6bc7 -> at org.springframework.data.redis.connection.jedis.JedisConnecti 
onFactory.fetchJedisConnector(JedisConnectionFactory.java:198) ~[spring-data-red 
is-1.7.2.RELEASE.jar!/:na] 
vb-be7e6bc7 -> at org.springframework.data.redis.connection.jedis.JedisConnecti 
onFactory.getConnection(JedisConnectionFactory.java:345) ~[spring-data-redis-1.7 
.2.RELEASE.jar!/:na] 
vb-be7e6bc7 -> at org.springframework.session.data.redis.config.annotation.web. 
http.RedisHttpSessionConfiguration$EnableRedisKeyspaceNotificationsInitializer.a 
fterPropertiesSet(RedisHttpSessionConfiguration.java:223) ~[spring-session-1.2.1 
.RELEASE.jar!/:na] 
vb-be7e6bc7 -> at org.springframework.beans.factory.support.AbstractAutowireCap 
ableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) 
~[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE] 
vb-be7e6bc7 -> at org.springframework.beans.factory.support.AbstractAutowireCap 
ableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[s 
pring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE] 
vb-be7e6bc7 -> ... 24 common frames omitted 
vb-be7e6bc7 -> Caused by: redis.clients.jedis.exceptions.JedisConnectionExceptio 
n: Could not get a resource from the pool 
vb-be7e6bc7 -> at redis.clients.util.Pool.getResource(Pool.java:53) ~[jedis-2.8 
.2.jar!/:na] 
vb-be7e6bc7 -> at redis.clients.jedis.JedisPool.getResource(JedisPool.java:99) 
~[jedis-2.8.2.jar!/:na] 
vb-be7e6bc7 -> at redis.clients.jedis.JedisPool.getResource(JedisPool.java:12) 
~[jedis-2.8.2.jar!/:na] 
vb-be7e6bc7 -> at org.springframework.data.redis.connection.jedis.JedisConnecti 
onFactory.fetchJedisConnector(JedisConnectionFactory.java:191) ~[spring-data-red 
is-1.7.2.RELEASE.jar!/:na] 
vb-be7e6bc7 -> ... 28 common frames omitted 
vb-be7e6bc7 -> Caused by: redis.clients.jedis.exceptions.JedisConnectionExceptio 
n: java.net.ConnectException: Connection refused 
vb-be7e6bc7 -> at redis.clients.jedis.Connection.connect(Connection.java:164) ~ 
[jedis-2.8.2.jar!/:na] 
vb-be7e6bc7 -> at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:80 
) ~[jedis-2.8.2.jar!/:na] 
vb-be7e6bc7 -> at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1677 
) ~[jedis-2.8.2.jar!/:na] 
vb-be7e6bc7 -> at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java 
:87) ~[jedis-2.8.2.jar!/:na] 
vb-be7e6bc7 -> at org.apache.commons.pool2.impl.GenericObjectPool.create(Generi 
cObjectPool.java:868) ~[commons-pool2-2.4.2.jar!/:2.4.2] 
vb-be7e6bc7 -> at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(
GenericObjectPool.java:435) ~[commons-pool2-2.4.2.jar!/:2.4.2] 
vb-be7e6bc7 -> at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(
GenericObjectPool.java:363) ~[commons-pool2-2.4.2.jar!/:2.4.2] 
vb-be7e6bc7 -> at redis.clients.util.Pool.getResource(Pool.java:49) ~[jedis-2.8 
.2.jar!/:na] 
vb-be7e6bc7 -> ... 31 common frames omitted 
vb-be7e6bc7 -> Caused by: java.net.ConnectException: Connection refused 
vb-be7e6bc7 -> at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1. 
8.0-8u102] 
vb-be7e6bc7 -> at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocke 
tImpl.java:350) ~[na:1.8.0-8u102] 
vb-be7e6bc7 -> at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPla 
inSocketImpl.java:206) ~[na:1.8.0-8u102] 
vb-be7e6bc7 -> at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketI 
mpl.java:188) ~[na:1.8.0-8u102] 
vb-be7e6bc7 -> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[ 
na:1.8.0-8u102] 
vb-be7e6bc7 -> at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0-8u102] 
vb-be7e6bc7 -> at redis.clients.jedis.Connection.connect(Connection.java:158) ~ 
[jedis-2.8.2.jar!/:na] 
vb-be7e6bc7 -> ... 38 common frames omitted 

我曾嘗試以下,但沒有工作:

回答

1

看起來像一個連接問題,檢查以下項目:

配置不匹配

在你的Redis redis.conf文件中找到綁定的配置和端口默認爲

bind 127.0.0.1 
port 6379 

JedisConnec使用的jedis的默認值tionFactory(看你的堆棧跟蹤)是:

bind localhost 
port 6379 

見jedis客戶Protocol和Spring數據JedisConnectionFactory類。

如果不使用JedisShardInfo 來更新你的配置確保那些符合你的春天啓動的應用程序配置 ,JedisConnectionFactory接受JedisShardInfo在它的constractor。

確保你的/ etc/hosts或C:\ WINDOWS \ SYSTEM32 \ DRIVERS \等\主機 具有項

127.0.0.1  localhost 

Altough trivail有時有人CHAGE或刪除。

Redis的啓動失敗

確保您的Redis的啓動和運行,也許不同的進程正在使用Redis的端口。 使用

netstat –anp | grep 6379 

或Windows

netstat –ano | find 「6379」 

如果您發現使用其他進程的端口相應地調整

也看到 What can be the reasons of connection refused errors?

+0

謝謝您的回答,但沒有工作.. – CandleCoder

+0

你能提供你的彈簧啓動配置嗎? –

+0

buildscript { \t ext { \t \t springBootVersion ='1.4.0。RELEASE」 \t} \t庫{ \t \t mavenCentral() \t} \t依賴{ \t \t類路徑( 「org.springframework.boot:彈簧引導gradle這個-插件:$ {} springBootVersion」) \t }} 應用插件: '的java' 應用插件: '蝕' 應用插件: '彈簧引導' 罐子{ \t baseName的=「本身起動轉矩 ' \t版本= '0.0.1-快照' } sourceCompatibility = 1.8 targetCompatibility = 1.8 庫{ \t mavenCentral() } – CandleCoder

相關問題