Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR invalid ...

io.lettuce.core.RedisCommandExecutionException: ERR invalid longitude,latitude pair 111.110000,111.230000
    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]

可以看到redis在操作geo的时候,我的数据又出问题了,

看代码:

    @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);

    }

“经度最大是180° 最小是0°纬度最大是 90° 最小是0°

那么我这个地方所以出问题了,可以得知问题所在

修改:

    @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,11.23),"cxy");
        String s = redisTemplate.boundGeoOps("1111").toString();
        System.out.println(s);

    }

可以得知没有报错了

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 13
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值