文章目录
hibernate
映射策略
一、nosql
- javaee
classpath 和 classpath* 区别、
不再resources目录中 classpath:你的目录/eheache.xml
2)数字类型值太大:如 id自增太大,前端接受后精度丢失
1325041912076988419 主键自增,mybatis 查询空
@JsonSerialize(using = ToStringSerializer.class) 转出字符串避免精度丢失
3) 富文本 传入后台与后台接收
前端通过encodeURIComponent()或者encodeURI()转码后再传
encodeURIComponent java.net.URLDecoder.decode(works, “UTF-8”);
4) OPTIONS请求时设置了Header请求和token可是后台接收不到
拦截器增加
拦截器增加:
if (httpServletRequest.getMethod().equals("OPTIONS")) {
httpServletResponse.setStatus(HttpServletResponse.SC_OK);
return true;
}
5) 同一个工程同一个包路径的同一个class不能强转
同一个class在进行集合、遍历等计算时,提示该class不能转换成该class
原因:热加载
可能猜测:多个不同的热加载器?
6)stream
List<Student> projectTypeList= new ArrayList();
Long[] tempIds = projectTypeList.stream().map(ProjectType :: getId).toArray(Long[]::new);
Long[] tempIds =new Long[2];
Long[] tyIds = Stream.concat(Stream.of(tyIds), Stream.of(tempIds)).toArray(Long[]::new);
二、 springmvc
1)
Controller 前置控制器的 3 种实现方式,1)@controller 2)接口controller 3) 接口HttpRequestHandler
2)
model 没有 没有提供get set 方法 导致 返回json只有一个属性 其它丢掉了
三、权限
- springBoot
- @EnableAutoConfiguration(exclude 过时
2.x后改为yml配置 spring.application.autoconfigure.exclude
2)
spring boot中配置多个DispatcherServlet
- mybatis-plus springboot整合
找不到BaseMapper中的crud方法,配置MappperScan无效。在排除了pom存在的大量jar冲突,将boot升级到2.3.3,再将冲突jar排除、升级相关依赖jar之后,再次整合成功 - 排除 日志多个 binding绑定,boot项目引入了boot-web包含了slf4j ,删掉.排除掉其它所有日志依赖引入
- hutool 找不到log4j
在db.setting 设置了filter 日志用 log4j在com.alibaba.druid.pool.DruidDataSource#configFromPropety 264行设置时报错。再往后追就是com.alibaba.druid.filter.FilterManager#loadFilter - springboot默认用的是slf4j 包含在boot-web中,其它额外引入的日志jar可以直接删除
五、 版本管理一些记录
- 迁移项目 项目迁移 idea eclipse
1)
导入项目,没有修改maven地址,还是迁移之前的路径
hError running : No valid Maven installation found. Either set the home directory in the
2 )
eclipse 非maven web项目 迁移到 idea
eclipse 转 idea ssm项目
idea 加载 eclipse maven
打开pom文件,先修改maven为国内。。其它方式导入 右侧不会显示maven 选项
Could not find artifact .::pom:0.0.1-SNAPSHOT 父类version值和model引入父类时指定的version值不一致
idea导入eclipse springboot 项目
3)
a、 ——>idea 导入阿里云 aliyun-sdk-oss-3.10.2.jar 仍然找不到 OSSClientBuilder OSS 把 Artifacts 删掉 重新 tomcat deployment删掉重新 ,也可能是target缓存
b、 ——> 一开始把jar放在lib中能立即生效,后来在放的时候无法立即生效,环境配置未曾变动。可能是target缓存?
4)
Springboot项目下mybatis报错:Invalid bound statement (not found)
target\classes\ 缓存,删掉
5 ) 非maven改成maven
6 ) idea 创建 Artifacts之后 提示fix 修复lib
选择add lib to artifact
7 ) idea 弹出Server’s certificate is not trusted 解决方法
2、module -> 选中项目 --> lib类型改为 compile
3、package报红,编译不会报错提示、mapper引入路径错误启动项目才会提示,编译无提示
六、 linux
chkconfig --list
查看 系统启动服务列表
或者 systemctl list-unit-files
查看 乌班图 或者 red hat版本
cat /proc/version
a、
nacos安装 win版
b、
centos7下/etc/sysconfig/目录没有iptables问题
c、
erlang: wx-config: command not found或wxWidgets must be installed on your system.
b、
rpm安装 成功
经历步骤:
mysql linux 官网下载路径
linux安装5.5版本mysql_spring20l6的博客-CSDN博客_linux安装mysq
No such file or directory
Neither host ‘localhost.localdomain’ nor ‘localhost’ could be looked up with
./bin/resolveip
Please configure the ‘hostname’ command to return a correct
hostname.
If you want to solve this
CentOS7修改主机名的三种方法
修改主机名
修改后无效 : 64位 安装成 32位 导致的
Unit mysqld.service could not be found.
修改后 启动命令为 service mysqld start
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
其它源码安装博客
systemctl enable mysqld.service
启用服务