NutzCN Logo
问答 tomcat启动报错,redis连接有问题
发布于 187天前 作者 binfoo 123 次浏览 复制 上一个帖子 下一个帖子
标签:

日志

19-Apr-2017 10:38:21.133 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.filterStart Exception starting filter nutz
 org.nutz.mvc.LoadingException: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:17)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:990)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:197)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:135)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at com.landleaf.www.mvc.WechatServiceNutFilter.init(WechatServiceNutFilter.java:18)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4659)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
	at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1692)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:465)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$256(TCPTransport.java:683)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
	at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:201)
	at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
	at redis.clients.jedis.Protocol.process(Protocol.java:141)
	at redis.clients.jedis.Protocol.read(Protocol.java:205)
	at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
	at redis.clients.jedis.Connection.getIntegerReply(Connection.java:222)
	at redis.clients.jedis.Jedis.exists(Jedis.java:127)
	at com.landleaf.www.MainSetup.init(MainSetup.java:62)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:277)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
	... 52 more
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:170)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at java.net.SocketInputStream.read(SocketInputStream.java:127)
	at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:195)
	... 61 more

MainSetup启用了id生成器
// 初始化redis实现的id生成器
CustomMake.me().register("ig", ioc.get(RedisIdGenerator.class));
try (Jedis jedis = jedisAgent.getResource()) {
for (Class<?> klass : Scans.me().scanPackage(getClass().getPackage().getName())) {
if (klass.getAnnotation(Table.class) != null &&
IdentityPojo.class.isAssignableFrom(klass)) {
String tableName = dao.getEntity(klass).getTableName();
if (!jedis.exists("ig:" + tableName)) {
int max = dao.getMaxId(klass);
if (max > 0) {
jedis.set("ig:" + tableName, "" + max);
}
}
}
}
}

12 回复

redis没启动??

[19080] 19 Apr 10:48:29 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
[19080] 19 Apr 10:48:29 * Server started, Redis version 2.4.5
[19080] 19 Apr 10:48:29 * DB loaded from disk: 0 seconds
[19080] 19 Apr 10:48:29 * The server is now ready to accept connections on port 6379
[19080] 19 Apr 10:48:30 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19080] 19 Apr 10:48:37 - 0 clients connected (0 slaves), 1180080 bytes in use

显示这个了,应该启动了

本机? 远程???

redis-cli能连???

redis.enable=true
redis.host=localhost
redis.port=6379
redis.timeout=2000

redis.password=wendal.net

redis.database=0

redis.host=192.168.88.118

redis.port=7000

redis.mode=cluster

默认的redis.properties

你不是说本机吗? 写个redis.host=192.168.88.118干啥?

又重启了一次,突然全部都好了,诡异啊。。

redis 127.0.0.1:6379> keys *
 1) "ig:t_sysuser"
 2) "stats:page:about"
 3) "hu:accesstoken183519607513"
 4) "hu:accesstoken1"
 5) "ig:t_user"
 6) "hu:accesstoken18351960e751"
 7) "user:leto"
 8) "_landleaf_test_key"
 9) "ratings:video:12333"
10) "users:leto"
11) "users:goku"
12) "_nutzbook_test_key"
13) "hu:accesstoken15651085135"
14) "hu:accesstokennull"
15) "hu:accesstoken18351960751"

那个是注册掉的

redis.enable=true
redis.host=localhost
redis.port=6379
redis.timeout=2000

redis.password=wendal.net

redis.database=0

redis.host=192.168.88.118

redis.port=7000

redis.mode=cluster

所有的黑色粗体都有#

回复按钮旁边的"插入代码/日志"总是没人看到-_-

添加回复
请先登陆
回到顶部