Maven项目运行测试类程序包不存在问题解决方法

简介

报错示例:
Error:(6, 29) java: 程序包rg.bouncycastle.asn1不存在
Error:(3, 32) java: 程序包org.springframework.boot不存在

实际依赖的jar包都能找到,也可以打包成功,但就是运行项目或测试用例时提示包不存在。

解决方法

方法一:勾选Delegate IDE build/run actions to Maven

将IDE构建/运行操作委托给Maven。

具体步骤:
在Idea编辑器中打开File--Settings--Build, Execution, Deployment--Build Tools--Maven--Runner页面,勾选Delegate IDE build/run actions to Maven即可。

此方式效率低,启动慢,每次需编译所有模块。

为什么要使用Docker容器化技术

什么是Docker?

Docker 是一个开源的应用容器引擎,基于Go语言开发。让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux或Windows操作系统的机器上。容器是完全使用沙箱机制,不同容器之间是相互隔离的,可以通过网络互相通信。

Docker 从 17.03 版本之后分为 CE(Community Edition: 社区版) 和 EE(Enterprise Edition: 企业版),我们用社区版就可以了。

一个完整的Docker由以下几个部分组成:
Docker Client客户端
Docker Daemon守护进程
Docker Image镜像
Docker Container容器

Springboot介绍

1、Springboot简介
SpringBoot基于Spring4.0设计,不仅继承了Spring框架原有的优秀特性,而且还通过简化配置来进一步简化了Spring应用的整个搭建和开发过程。

另外SpringBoot通过集成大量的框架使得依赖包的版本冲突,以及引用的不稳定性等问题得到了很好的解决。

SpringBoot所具备的特征有:
(1)可以创建独立的Spring应用程序,并且基于其Maven或Gradle插件,可以创建可执行的JARs和WARs;
(2)内嵌Tomcat或Jetty等Servlet容器;
(3)提供自动配置的“starter”项目对象模型(POMS)以简化Maven配置;
(4)尽可能自动配置Spring容器;
(5)提供准备好的特性,如指标、健康检查和外部化配置;
(6)绝对没有代码生成,不需要XML配置。

[ERR] 1153 - Got a packet bigger than 'max_allowed_packet' bytes 解决方法

简介

max_allowed_packet 表示MySQL客户端和服务器之间,单条消息最大允许传输的数据包大小。

如果单条SQL插入或更新的数据包超过此大小,就会报错:
[ERR] 1153 - Got a packet bigger than 'max_allowed_packet' bytes

官方解释:

max_allowed_packet sets an upper limit on the size of any single message between the MySQL server and clients, including replication slaves. If you are replicating large column values (such as might be found in TEXT or BLOB columns) and max_allowed_packet is too small on the master, the master fails with an error, and the slave shuts down the I/O thread. If max_allowed_packet is too small on the slave, this also causes the slave to stop the I/O thread.

MySQL 1819 - Your password does not satisfy the current policy requirements

mysql修改密码时提示:
1819 - Your password does not satisfy the current policy requirements

产生的原因:
自定义密码太简单,不符合mysql的密码策略

解决方法:
方法一:修改密码至符合mysql的密码策略(建议)。
方法二:如果必须用简单密码,可以修改密码策略;