码迷,mamicode.com
首页 > 其他好文 > 详细

io.lettuce.core.RedisCommandExecutionException: ERR unknown command 'GEOADD'

时间:2019-11-25 11:27:06      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:ast   runnable   safe   option   oid   cut   一个   event   method   

io.lettuce.core.RedisCommandExecutionException: ERR unknown command GEOADD
    at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:135) ~[lettuce-core-5.1.8.RELEASE.jar:na]
    at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:108) ~[lettuce-core-5.1.8.RELEASE.jar:na]
    at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:120) ~[lettuce-core-5.1.8.RELEASE.jar:na]
    at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:111) ~[lettuce-core-5.1.8.RELEASE.jar:na]
    at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:646) ~[lettuce-core-5.1.8.RELEASE.jar:na]
    at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:604) ~[lettuce-core-5.1.8.RELEASE.jar:na]
    at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:556) ~[lettuce-core-5.1.8.RELEASE.jar:na]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-all-4.1.40.Final.jar:4.1.40.Final]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]

再看接口代码:

 @RequestMapping(value = "/s/{id}", method = RequestMethod.GET)
    @ResponseBody
    public void detail22(@PathVariable Long id) {

       /* Cursor scan = redisTemplate.opsForHash().scan("1", ScanOptions.NONE);
        Set<String> keys = redisTemplate.keys("1111");
        for(String key:keys){
            System.out.println(key);
        }*/

        redisTemplate.boundGeoOps("1111").add(new Point(111.11,111.23),"cxy");
        String s = redisTemplate.boundGeoOps("1111").toString();
        System.out.println(s);

    }

这段代码是在操作redis的geo数据类型,再看我的redis版本:3.0.504  这个是比较久的版本,不支持geo数据类型,所以报错,geo的数据类型是在redis3.2版本以后才支持的数据类型,所以需要切换一个redis的版本

io.lettuce.core.RedisCommandExecutionException: ERR unknown command 'GEOADD'

标签:ast   runnable   safe   option   oid   cut   一个   event   method   

原文地址:https://www.cnblogs.com/xiufengchen/p/11926260.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!