(澳门正规博彩十大网站) 在公司运行正常的maven项目 ,为什么到宿舍就运行不了。

1.我是新人,不是很懂
2.我把公司的maven项目检出到自己笔记本上,在公司运行正常
3.可是回到宿舍我项目就运行不了,报错
4.报错内容如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name redisCli defined in class path resource [config/cacheContext.xml]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBeanAbstractAutowireCapableBeanFactory.java:1553
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBeanAbstractAutowireCapableBeanFactory.java:539
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanAbstractAutowireCapableBeanFactory.java:475
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjectAbstractBeanFactory.java:304
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingletonDefaultSingletonBeanRegistry.java:228
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBeanAbstractBeanFactory.java:300
at org.springframework.beans.factory.support.AbstractBeanFactory.getBeanAbstractBeanFactory.java:195
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletonsDefaultListableBeanFactory.java:700
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitializationAbstractApplicationContext.java:760
at org.springframework.context.support.AbstractApplicationContext.refreshAbstractApplicationContext.java:482
at com.aida.commons.redis.MybatisRedisCache.<init>MybatisRedisCache.java:63
at sun.reflect.NativeConstructorAccessorImpl.newInstance0Native Method
at sun.reflect.NativeConstructorAccessorImpl.newInstanceNativeConstructorAccessorImpl.java:62
at sun.reflect.DelegatingConstructorAccessorImpl.newInstanceDelegatingConstructorAccessorImpl.java:45
at java.lang.reflect.Constructor.newInstanceConstructor.java:422
at org.apache.ibatis.mapping.CacheBuilder.newBaseCacheInstanceCacheBuilder.java:183
at org.apache.ibatis.mapping.CacheBuilder.buildCacheBuilder.java:93
at org.apache.ibatis.builder.MapperBuilderAssistant.useNewCacheMapperBuilderAssistant.java:133
at org.apache.ibatis.builder.xml.XMLMapperBuilder.cacheElementXMLMapperBuilder.java:210
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElementXMLMapperBuilder.java:114
at org.apache.ibatis.builder.xml.XMLMapperBuilder.parseXMLMapperBuilder.java:92
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactorySqlSessionFactoryBean.java:466
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSetSqlSessionFactoryBean.java:343
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethodsAbstractAutowireCapableBeanFactory.java:1612
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBeanAbstractAutowireCapableBeanFactory.java:1549
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBeanAbstractAutowireCapableBeanFactory.java:539
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanAbstractAutowireCapableBeanFactory.java:475
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjectAbstractBeanFactory.java:304
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingletonDefaultSingletonBeanRegistry.java:228
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBeanAbstractBeanFactory.java:300
at org.springframework.beans.factory.support.AbstractBeanFactory.getBeanAbstractBeanFactory.java:195
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletonsDefaultListableBeanFactory.java:681
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitializationAbstractApplicationContext.java:760
at org.springframework.context.support.AbstractApplicationContext.refreshAbstractApplicationContext.java:482
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContextContextLoader.java:381
at org.springframework.web.context.ContextLoader.initWebApplicationContextContextLoader.java:293
at org.springframework.web.context.ContextLoaderListener.contextInitializedContextLoaderListener.java:106
at org.apache.catalina.core.StandardContext.listenerStartStandardContext.java:4813
at org.apache.catalina.core.StandardContext.startInternalStandardContext.java:5272
at org.apache.catalina.util.LifecycleBase.startLifecycleBase.java:147
at org.apache.catalina.core.ContainerBase$StartChild.callContainerBase.java:1407
at org.apache.catalina.core.ContainerBase$StartChild.callContainerBase.java:1397
at java.util.concurrent.FutureTask.runFutureTask.java:266
at java.util.concurrent.ThreadPoolExecutor.runWorkerThreadPoolExecutor.java:1142
at java.util.concurrent.ThreadPoolExecutor$Worker.runThreadPoolExecutor.java:617
at java.lang.Thread.runThread.java:745

Caused by: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnectorJedisConnectionFactory.java:140
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnectionJedisConnectionFactory.java:229
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnectionJedisConnectionFactory.java:57
at com.aida.commons.redis.RedisCli.clearRedisCli.java:159
at sun.reflect.NativeMethodAccessorImpl.invoke0Native Method
at sun.reflect.NativeMethodAccessorImpl.invokeNativeMethodAccessorImpl.java:62
at sun.reflect.DelegatingMethodAccessorImpl.invokeDelegatingMethodAccessorImpl.java:43
at java.lang.reflect.Method.invokeMethod.java:497
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethodAbstractAutowireCapableBeanFactory.java:1681
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethodsAbstractAutowireCapableBeanFactory.java:1620
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBeanAbstractAutowireCapableBeanFactory.java:1549
... 45 more

Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

at redis.clients.util.Pool.getResourcePool.java:53
at redis.clients.jedis.JedisPool.getResourceJedisPool.java:99
at redis.clients.jedis.JedisPool.getResourceJedisPool.java:11
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnectorJedisConnectionFactory.java:133
... 55 more

Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out

at redis.clients.jedis.Connection.connectConnection.java:148
at redis.clients.jedis.BinaryClient.connectBinaryClient.java:75
at redis.clients.jedis.BinaryJedis.connectBinaryJedis.java:1790
at redis.clients.jedis.JedisFactory.makeObjectJedisFactory.java:71
at org.apache.commons.pool2.impl.GenericObjectPool.createGenericObjectPool.java:819
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObjectGenericObjectPool.java:429
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObjectGenericObjectPool.java:360
at redis.clients.util.Pool.getResourcePool.java:51
... 58 more

Caused by: java.net.SocketTimeoutException: connect timed out

at java.net.DualStackPlainSocketImpl.waitForConnectNative Method
at java.net.DualStackPlainSocketImpl.socketConnectDualStackPlainSocketImpl.java:85
at java.net.AbstractPlainSocketImpl.doConnectAbstractPlainSocketImpl.java:350
at java.net.AbstractPlainSocketImpl.connectToAddressAbstractPlainSocketImpl.java:206
at java.net.AbstractPlainSocketImpl.connectAbstractPlainSocketImpl.java:188
at java.net.PlainSocketImpl.connectPlainSocketImpl.java:172
at java.net.SocksSocketImpl.connectSocksSocketImpl.java:392
at java.net.Socket.connectSocket.java:589
at redis.clients.jedis.Connection.connectConnection.java:142

应该是redis连接不上引起的。可能是公司只让内网访问,外网访问不了超时了。也有可能是redis配置问题。检查下吧。

本地的redis你配置的是不是有问题啊?

可能是redis配置了只能内网连接,你在公司用的内网启动程序正常,你回到宿舍用的外网,redis连接获取不成功就报了

Caused by: java.net.SocketTimeoutException: connect timed out

检查你的redis配置吧

redis连接改一下.自己本地启动一个试试看.

发表评论

电子邮件地址不会被公开。 必填项已用*标注