1

空指针异常:
image
或者:
image

image
image
分析原因:因为项目是springboot+dubbo架构,dao项目依赖于pojo项目,在pojo项目中也有启动类@SpringBootApplication,因为在dao的测试类中启动方法时,会加载pojo项目启动类,所以会造成上图所示错误,注释掉pojo项目启动类上的@SpringBootApplication注解即可!

依赖注入异常:
image
或者有:
image

image
解决方法多种如下图

image

此处是没有对应的配置文件
:没有对应的配置文件
image
解决方法:如下图:
image

mapper问题:image

赖包问题:image

映射问题:
image

异常不是关键,需要继续找关键问题:
image

springboot中查询表中的数据时有:
image

image

image

image

image

端口被占用解决方法:
image
这是一个未知的数据库;出现这样的数据库时,如下图:查看是否有与此数据库有链接到properties文件中查看
image

没有发现类:
image

Bean ont be found 解决方法:
image

模板错误解决方法:
位置写错,可以看前端与后端的代码:如图!
image

bean报错!!
image

SpringBoot中整合redis

redis.clients.jedis.exceptions.JedisNoReachableClusterNodeException: No reachable node in cluster

image

异常:Redis集群的node(节点)连接失败;
造成原因:<1>检查Redis是否正常启动(如图正常)

image
image

<2>检查防火墙是否关闭(Linux与windows均需要关闭);

命令:Centos 6/6.4/6.5
永久关闭防火墙: chkconfig iptables off
永久打开防火墙: chkconfig iptables on
临时关闭防火墙:service iptables stop
临时打开防火墙:service iptables start
查看防火墙状态:service iptables status
命令:Centos 7及以上
启动: systemctl start firewalld.service (.service可以省略)
关闭: systemctl stop firewalld.service
查看状态: systemctl status firewalld.service
开机禁用 : systemctl disable firewalld.service
开机启用 : systemctl enable firewalld.service

<2>Redis集群的node节点IP异常

我的Linux系统IP:
源文件配置节点信息:
image
image.png
BuildingException
image


Kirc
4 声望0 粉丝