随笔分类 -  JAVA

上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页
JAVA
摘要:WebService cxf No compiler detected, make sure you are running on top of a JDK instead of a JRE [2022-11-14 09:55:01.644] ERROR [scheduling-1] ZysoftS 阅读全文
posted @ 2022-11-14 10:17 VipSoft 阅读(381) 评论(0) 推荐(0) 编辑
摘要:Intellij IDEA 中运行正常,linux 运行正常, cmd 下运行 报:MalformedInputException: Input length = 1 微服务项目,在Nacos中做了配置,在引用 Nacos中配置时,编码问题,导致的错误 org.yaml.snakeyaml.erro 阅读全文
posted @ 2022-11-09 10:13 VipSoft 阅读(543) 评论(0) 推荐(0) 编辑
摘要:下载文件 SpringBoot 接口输出文件流 & Vue 下载文件流,获取 Header 中的文件名 @SpringBootTest class DownloadTests { Logger logger = LoggerFactory.getLogger(this.getClass()); Co 阅读全文
posted @ 2022-10-09 13:46 VipSoft 阅读(936) 评论(0) 推荐(0) 编辑
摘要:驼峰下划线互转 /** * 将驼峰风格替换为下划线风格 */ public static String camelhumpToUnderline(String str) { final int size; final char[] chars; final StringBuilder sb = ne 阅读全文
posted @ 2022-09-21 09:30 VipSoft 阅读(106) 评论(0) 推荐(0) 编辑
摘要:Spring Boot JWT 用户认证 JWT token验证后,通过 ThreadLocal 进行传值,在服务层直接使用 Threadlocal 获取当前用户,的Id、姓名,进行行为记录 定义一个用户实体类 package com.vipsoft.core.user.entity; import 阅读全文
posted @ 2022-09-13 21:27 VipSoft 阅读(288) 评论(0) 推荐(0) 编辑
摘要:[2022-09-07 11:45:35.517] [Druid-ConnectionPool-Create-5339735] [ERROR] com.alibaba.druid.pool.DruidDataSource - create connection SQLException, url: 阅读全文
posted @ 2022-09-07 12:00 VipSoft 阅读(5720) 评论(0) 推荐(0) 编辑
摘要:SpringBoot 配置多数据源 无非就是namespace写错了、mapper接口或者xml文件名字没对应上等 mapper.xml中的namespace和实际的mapper文件不一致 mapper接口中的方法名和mapper.xml中的id标签不一致 Mapper.xml没有构建进去 打开ta 阅读全文
posted @ 2022-09-07 11:23 VipSoft 阅读(82) 评论(0) 推荐(0) 编辑
摘要:SpringBoot 接口输出文件流 & Vue 下载文件流,获取 Header 中的文件名 为什么浏览器中有些文件点击后是预览,有些是下载:https://www.cnblogs.com/vipsoft/p/18267174 Spring Boot 接口返回文件流 :https://www.cnb 阅读全文
posted @ 2022-09-06 17:50 VipSoft 阅读(2974) 评论(0) 推荐(0) 编辑
摘要:根据前端传入不同的支付code,动态找到对应的支付方法,发起支付。我们先定义一个注解。 @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface PayCode { String value(); 阅读全文
posted @ 2022-09-05 09:25 VipSoft 阅读(104) 评论(0) 推荐(0) 编辑
摘要:Spring Boot 在Windows CMD 中运行,日志输出中文乱码name="CONSOLE" 设置成 charset utf-8 ,在windows cmd 中运行时,log日志输出显示乱码,去掉即口 <appender name="CONSOLE" class="ch.qos.logba 阅读全文
posted @ 2022-09-01 14:43 VipSoft 阅读(1326) 评论(0) 推荐(1) 编辑
摘要:logback.xml <?xml version="1.0" encoding="UTF-8"?> <configuration> <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径--> <!--<property name="LOG_HOME" value="${LOG 阅读全文
posted @ 2022-09-01 14:38 VipSoft 阅读(681) 评论(0) 推荐(0) 编辑
摘要:No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc 有一种可能,就是配置文件里面没有赋值 @FeignClient(name = "vipsoft-a 阅读全文
posted @ 2022-08-29 17:03 VipSoft 阅读(327) 评论(0) 推荐(0) 编辑
摘要:JAVA PDF 截取N页,生成新文件,转图片,多个PDF 合并 <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.13</version> </dependency 阅读全文
posted @ 2022-08-25 16:48 VipSoft 阅读(695) 评论(0) 推荐(0) 编辑
摘要:MAC 转 Byte[] 数组 /** * MAC 地址转 byte[] * 默认以小端序转换 * * @param macAddr "E4:54:E8:81:FC:FD" * @return byte数组 */ public static byte[] macToBytes(String macA 阅读全文
posted @ 2022-08-16 16:02 VipSoft 阅读(238) 评论(0) 推荐(0) 编辑
摘要:CompletableFuture 使用 @Test public void billiardTest() throws Exception { // 创建点外卖线程: CompletableFuture<Boolean> takeaway = CompletableFuture.supplyAsy 阅读全文
posted @ 2022-08-12 13:09 VipSoft 阅读(20) 评论(0) 推荐(0) 编辑
摘要:C# //创建一个长度为10的byte数组,并且其中每个byte的值为0x08. byte[] myByteArray = Enumerable.Repeat((byte)0x08, 10).ToArray(); byte[] res= Enumerable.Range(1, 1000).Selec 阅读全文
posted @ 2022-08-10 11:51 VipSoft 阅读(344) 评论(0) 推荐(0) 编辑
摘要:1、缓冲区分片在 NIO 中,除了可以分配或者包装一个缓冲区对象外,还可以根据现有的缓冲区对象来创建一个子缓冲区,即在现有缓冲区上切出一片来作为一个新的缓冲区,但现有的缓冲区与创建的子缓冲区在底层数组层面上是数据共享的,也就是说,缓冲区相当于是现有缓冲区的一个视图窗口。调用 slice()方法可以创 阅读全文
posted @ 2022-08-03 14:53 VipSoft 阅读(90) 评论(0) 推荐(0) 编辑
摘要:SocketChannel支持设定参数SO_SNDBUF 套接字发送缓冲区大小SO_RCVBUF 套接字接收缓冲区大小SO_KEEPALIVE 保护连接O_REUSEADDR 复用地址SO_LINGER 有数据传输时延缓关闭Channel(非阻塞模式下有用)TCP_NODELAY 禁用Nagle算法 阅读全文
posted @ 2022-08-02 15:50 VipSoft 阅读(59) 评论(0) 推荐(0) 编辑
摘要:FileLock是文件锁,它能保证同一时间只有一个进程(程序)能够修改它,或者都只可以读,这样就解决了多进程间的同步文件,保证了安全性。但是需要注意的是,它进程级别的,不是线程级别的,他可以解决多个进程并发访问同一个文件的问题,但是它不适用于控制同一个进程中多个线程对一个文件的访问。这也是为什么它叫 阅读全文
posted @ 2022-08-01 15:42 VipSoft 阅读(657) 评论(0) 推荐(0) 编辑
摘要:1.start()方法来启动线程,真正实现了多线程运行。这时无需等待run方法体代码执行完毕,可以直接继续执行下面的代码;通过调用Thread类的start()方法来启动一个线程, 这时此线程是处于就绪状态, 并没有运行,等待分配到CPU后继续执行未完的run()方法。 这里方法run()称为线程体 阅读全文
posted @ 2022-08-01 15:00 VipSoft 阅读(652) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页