随笔分类 -  JAVA

上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
JAVA
摘要:应用场景如:我们可以在开发、测试环境中,启用 Swagger,在生产环境中不启用 package com.vipsoft.web.boot.config; import springfox.documentation.service.Contact; import org.springframewo 阅读全文
posted @ 2022-01-20 16:09 VipSoft 阅读(124) 评论(0) 推荐(0) 编辑
摘要:SpringBoot 配置多数据源,注意 Mapper XML 的目录创建 Invalid bound statement (not found) idea 中创建目录时,不能直接 mappet.hospital yml配置 spring: datasource: # MySQL java的new 阅读全文
posted @ 2022-01-20 15:18 VipSoft 阅读(346) 评论(0) 推荐(0) 编辑
摘要:preHandle 调用时间:Controller方法处理之前 执行顺序:链式Intercepter情况下,Intercepter按照声明的顺序一个接一个执行 若返回false,则中断执行,注意:不会进入afterCompletion postHandle 调用前提:preHandle返回true 阅读全文
posted @ 2022-01-20 14:44 VipSoft 阅读(203) 评论(0) 推荐(0) 编辑
摘要:你请求我接口,传了什么参数,我返回了什么值给你,全部记下来。防止扯皮 需求:记录每次用户请求Controller的Body参数, 思路:在每个Controller 该当中记录,容易漏记,如果在拦截器里面记的话,可以统一处理 问题:在postHandle 里面记,request.getInputStr 阅读全文
posted @ 2022-01-20 14:43 VipSoft 阅读(2223) 评论(0) 推荐(0) 编辑
摘要:如何将不同业务模块产生的日志 分多文件记录 Tomcat 中有个日志 loca_access.log 可以记录每个接口的请求耗时,用于做性能等分析比较有用,SpringBoot里,默认不记录这个日志,可以在 yml里做如下配置,开启这样的日志, server: tomcat: #basedir: / 阅读全文
posted @ 2022-01-14 09:38 VipSoft 阅读(1020) 评论(0) 推荐(0) 编辑
摘要:21:59 Error running 'Vipsoft': Cannot run program "/Users/jimmy/Java/apache-tomcat-9.0.14/bin/catalina.sh" (in directory "/Users/jimmy/Java/apache-tom 阅读全文
posted @ 2022-01-06 22:02 VipSoft 阅读(78) 评论(0) 推荐(0) 编辑
摘要:外部统一管理可用 xxl-job ,将各定时任务集中管理,灵活改变执行频率,支持某一个定时器集群处理,避免多服务启动时,每个服务都执行(重复执行) 比如我的API服务里有一个定时任务,将API做成集群时,变成了 API1、API2、API3 ,这时候每个API都有定时任务。但我只能让一个执行,不能也 阅读全文
posted @ 2021-12-31 09:33 VipSoft 阅读(287) 评论(0) 推荐(0) 编辑
摘要:NettyHandler 常用生命周期方法 @Component @ChannelHandler.Sharable //表示这里是线程安全的 public class ImServerHandler extends ChannelInboundHandlerAdapter { private sta 阅读全文
posted @ 2021-12-30 10:01 VipSoft 阅读(227) 评论(0) 推荐(0) 编辑
摘要:SpringBoot yml 小格子 变 小叶子 一般添加十多个模块后会出现这样的情况,正常情况下,看POM 文件里的 spring 引用是否异常 一般把 idea 关了再打开试试,有几次我是关了再开就好了。 1. File -> Project Structure -> Modules,选中模块, 阅读全文
posted @ 2021-12-22 14:32 VipSoft 阅读(151) 评论(0) 推荐(0) 编辑
摘要:也可以用 JNA,但性能没有 JNI 好。JNA的Demo没有做,可以参考(https://www.bilibili.com/video/BV1xU4y1F7Ep/?spm_id_from=autoNext) JNI 参考(https://www.runoob.com/w3cnote/jni-get 阅读全文
posted @ 2021-12-02 14:56 VipSoft 阅读(144) 评论(0) 推荐(0) 编辑
摘要:Exception in thread "main" java.lang.UnsatisfiedLinkError: com.vipsoft.demo.JNIDemo.testHello()V at com.vipsoft.demo.JNIDemo.testHello(Native Method) 阅读全文
posted @ 2021-12-02 14:05 VipSoft 阅读(1597) 评论(0) 推荐(0) 编辑
摘要:通过getter setter 模板设置 在实体类中 自动添加 @XmlTransient 按 【Alt+Insert】,弹出的提示中选择 Getter and Setter Xml Entity 实体互转(JAXB) Getter Template => JAXBGetter @XmlTransi 阅读全文
posted @ 2021-10-26 12:04 VipSoft 阅读(229) 评论(0) 推荐(0) 编辑
摘要:感觉比 xStream 操作起来复杂些 Xml Entity 实体互转(XStream)。但学习成本低些,不需要引用第三方依赖包 需要注意的是 实体中如果加了 getXX 需要在上面加上 @XmlTransient 否则会报“类的两个属性具有相同的名称 Intellij idea getter se 阅读全文
posted @ 2021-10-22 13:01 VipSoft 阅读(343) 评论(0) 推荐(0) 编辑
摘要:http://x-stream.github.io/tutorial.html 项目中用了 JAXB 方式 Xml Entity 实体互转(JAXB) 实体: import com.thoughtworks.xstream.annotations.XStreamAlias; import com.t 阅读全文
posted @ 2021-10-22 10:57 VipSoft 阅读(243) 评论(0) 推荐(0) 编辑
摘要:JProfiler(Java性能分析神器) v11.1.4 下载 安装目录不要有空格 安装成功后,在 Intellij 里面选择对应的 jprofiler.exe 路径 点击下图JProfiler图标运行 启动完成会自动弹出JProfiler窗口,在里面就可以监控自己的代码性能了。 使用参考: ht 阅读全文
posted @ 2021-10-20 09:59 VipSoft 阅读(412) 评论(0) 推荐(0) 编辑
摘要:Admin 服务端配置 添加 POM 引用 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <depende 阅读全文
posted @ 2021-10-12 09:03 VipSoft 阅读(716) 评论(0) 推荐(0) 编辑
摘要:添加自定义类: /** * 监控接口的健康情况 * */ @Component public class ApiHealthIndicator implements HealthIndicator { @Override public Health health() { Map<String, St 阅读全文
posted @ 2021-10-11 18:59 VipSoft 阅读(547) 评论(0) 推荐(0) 编辑
摘要:Spring Boot Admin 监控SpringBoot 服务的运行情况 https://codecentric.github.io/spring-boot-admin/2.3.0/#spring-boot-admin-server 1. Spring Boot Admin Server 服务端 阅读全文
posted @ 2021-10-09 13:11 VipSoft 阅读(653) 评论(0) 推荐(0) 编辑
摘要:java.util.concurrent.TimeoutException message Did not observe any item or terminal signal within 10000ms in 'map' (and no fallback has been configured 阅读全文
posted @ 2021-10-09 12:33 VipSoft 阅读(2677) 评论(0) 推荐(0) 编辑
摘要:一直处于离线状态 spring.boot.admin.client.instance.prefer-ip Use the ip-address rather then the hostname in the guessed urls. If server.address / management.a 阅读全文
posted @ 2021-10-09 10:16 VipSoft 阅读(1547) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页