随笔分类 - JAVA
JAVA
摘要:Feign 接口独立项目,报下列错误,原因是缺少指定扫描包 [2021-05-11 22:40:07.676] [main] [WARN ] o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception enco
阅读全文
摘要:解决方案 @Resourceprivate RestTemplate restTemplate;
阅读全文
摘要:Test 报错时,添加@注释 解决方案: @SpringBootTest(webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT)错误如下: org.springframework.beans.factory.UnsatisfiedDepe
阅读全文
摘要:基于 MongoDB 读写分离——Windows MongoDB 副本集配置 ,里面配置了一个坑,导致出现下列错误 [2021-05-10 10:06:11.981] [cluster-ClusterId{value='60989513a224157532b8e092', description='
阅读全文
摘要:成员变量的注入是在Bean创建成功之后,通过setter方法进行注入的。所以下面会获取不到值 @RestController public class VipsoftImController { @Autowired private ZooKeeperUtil zooKeeperUtil; @Req
阅读全文
摘要:logback 日志的开发者和log4j 的开发者是一波人,而springboot 默认日志是,较新的logback 日志。 但是在以前流行的日志却是log4j ,而且很多的第三方工具都含有log4j 得引入。 logback.xml 配置文件 排除 zookeeper 中的 log4j12 <de
阅读全文
摘要:Settings -> Inspections -> 注释 取消 “方法内部单行注释 xxxx ” 里面的勾,【设完后重启】如下图
阅读全文
摘要:pom文件中引用了 lombok 插件,但Intellij 代码里仍然是红色提示,具体操作如下 Mac
阅读全文
摘要:断点续传(上传)Java版 1. 客户每次上传前先获取一下当前文件已经被服务器接受了多少 2. 上传时设定偏移量 服务端代码如下: /// <summary> /// 断点续传,获取已上传文件大小 /// </summary> /// <returns></returns> [HttpPost] p
阅读全文
摘要:test下的包名和java下的包名不一致会产生下面错误 java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @Spri
阅读全文
摘要:[2021-01-15 13:20:14.623] ERROR [Druid-ConnectionPool-Create-497208183] DruidDataSource.java:2471 - create connection SQLException, url: jdbc:sqlserve
阅读全文
摘要:application.yml data: mongodb: uri: mongodb://127.0.0.1:27017,127.0.0.1:27018,127.0.0.1:27019/fecg_dev?slaveOk=true&replicaSet=rs0&write=1&readPrefere
阅读全文
摘要:本文基于:MongoDB 读写分离——MongoDB 安装 参考:https://docs.mongodb.com/manual/tutorial/deploy-replica-set-for-testing/ Master-Slave 主从复制 实现数据同步只需要在某一台服务器启动时加上"-mas
阅读全文
摘要:先到 https://www.u.tools/ 下载 uTools ,里面有好多插件, 下载安装后,打开uTools工具,搜索“内网穿透” 直接支持https,对于有https要求的,非常方便 点右边的图标,或者直接搜索 安装好后,到已安装里选择打开
阅读全文
摘要:通过 itextpdf 的 HtmlConverter.convertToPdf(); 方法生成的pdf 有点让人失望,CSS啥的不起作用了,(有可能我用得不对) 后来用 wkhtmltopdf.exe 做了 网页生成PDF 效果还可以,下面是JAVA代码,C#的差不多 public static
阅读全文
摘要:自带的 Alt+ Insert 中的 Getter and Setter 生成的属性,不能将 private 字段中的注释带过去,比较尴尬。可以通过两种试。 1. 修改模板:这种方法不能得到 private 字段上的属性 2. 下载插件:https://plugins.jetbrains.com/p
阅读全文
摘要:SpringBoot 引用仓库中没有 第三方包 - 将jar 包安装本地 maven, $ mvn install:install-file -Dfile=d:\Java\jave-1.0.2.jar -DgroupId=it.sauronsoftware -DartifactId=jave -Dversion=1.0.2 -Dpackaging=jar
java.lang.NoClassDefFoundError: it/sauronsoftware/jave/EncoderException
at java.lang.Class.getDeclaredConstructors0(Native Method)
阅读全文
摘要:JWT token验证后,通过 ThreadLocal 进行传值 https://jwt.io/#debugger 官网提供的 JAVA 工具还是挺多的,选了个 Star 比较多的 https://github.com/jwtk/jjwt 代码结构如图:需要源码联系QQ:47262947 1. 添加
阅读全文
摘要:简单安装为了集成 SpringBoot,真实使用,增加增加更多配置,比如将log映射出来 1.安装 zookeeper [root@centos-linux ~]# docker pull wurstmeister/zookeeper [root@centos-linux ~]# docker pu
阅读全文
摘要:1. 创建仓库 管理里面,可以查看详细的信息 设置登录密码 2. 接下来,将本地镜像推到阿里 : SpringBoot Docker 发布 docker commit 这部分可以不操作 docker commit -m "提交信息" -a "作者" 容器id 要创建的目标镜像名:标签名 [root@
阅读全文
浙公网安备 33010602011771号