数据大屏项目采坑01 (已解决)

数据大屏项目采坑01 (已解决)

  • 在做工地是数据大屏项目的时候,我们采用的技术是微服务,需要springboot与redis、zookeeper、dubbo等相结合

在开发过程中遇到了空指针异常,报错信息具体如下:

2022-03-02 13:12:53.530 ERROR 71824 --- [nio-8090-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException: null
	at com.qf.bigdata.view.web.service.impl.WorkerTotalServiceImpl.workerTotal(WorkerTotalServiceImpl.java:21) ~[classes/:na]
	at com.qf.bigdata.view.web.controller.api.WorkerController.getWorkerTotal(WorkerController.java:19) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_301]
	......

在这里插入图片描述

解决

step01

服务提供者的@Service是来自dubbo的Service,而不是springframework中的

step02

服务消费者的@Reference是来自dubbo的

step03

启动类要记得加@EnableDubbo

---------小插曲----------------------

当上述步骤全都做完之后,我发现报了一个新错,此时我很开心那,因为上面的问题就算是解决了,下面是新的错误信息

org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 192.168.100.107:6379
	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.translateException(LettuceConnectionFactory.java:1534) ~[spring-data-redis-2.3.6.RELEASE.jar:2.3.6.RELEASE]
	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1442) ~[spring-data-redis-2.3.6.RELEASE.jar:2.3.6.RELEASE]
	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1228) ~[spring-data-redis-2.3.6.RELEASE.jar:2.3.6.RELEASE]
	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getConnection(LettuceConnectionFactory.java:1211) ~[spring-data-redis-2.3.6.RELEASE.jar:2.3.6.RELEASE]
	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedConnection(LettuceConnectionFactory.java:975) ~[spring-data-redis-2.3.6.RELEASE.jar:2.3.6.RELEASE]
	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getConnection(LettuceConnectionFactory.java:360) ~[spring-data-redis-2.3.6.RELEASE.jar:2.3.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值