1、Application启动异常
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
大意:数据库未正常连接或未配置
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
2、解决方式——Nacos页面新建命名空间
Maven配置类——命名空间名
在Nacos新建命名空间——命名与Maven项目配置文件一致
3、数据库连接异常
create connection SQLException, url: jdbc:mysql://localhost:3306/pd_sms?serverTimezone=CTT&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true, errorCode 0, state 08001
4、解决方式——在Nacos配置区修改数据库配置文件
需先配置好命名空间才能进行这一步
修改IP地址到虚拟机IP
之所以如此是因为本地MySQL版本过低——别骂,就想试试虚拟机数据库
5、端口占用问题及解决
netty服务启动异常-Address already in use: bind
# 根据报错信息查找文件
[com.itherima.sms.netty.NettyServer.start:63]
6、Nacos注册问题——尚未解决,但不影响功能
nacos registry, pd-sms-api register failed...NacosRegistration{nacosDiscoveryProperties=NacosDiscoveryProperties{serverAddr='127.0.0.1:8848', endpoint='', namespace='pinda-sms', watchDelay=30000, logName='', service='pd-sms-api', weight=1.0, clusterName='DEFAULT', group='DEFAULT_GROUP', namingLoadCacheAtStart='false', metadata={preserved.register.source=SPRING_CLOUD, management.endpoints.web.base-path=/actuator, management.context-path=/actuator}, registerEnabled=true, ip='192.168.220.1', networkInterface='', port=8771, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null}},