druid connection holder is null 错误记录

场景 springboot 使用的是druid连接池 执行原生sql 直接注入了EntityManager 调用 createNativeQuery方法执行sql 问题 出现异常: Caused by: java.sql.SQLException: connection holder is null at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection. ...

java线程池如何关闭

try { executorService.shutdown(); while (!executorService.awaitTermination(1, TimeUnit.SECONDS)){ Thread.sleep(1000); } log.info("所有线程均已结束"); } catch (InterruptedException e) { e.printStackTrace(); } ...

java ThreadPoolExecutor 的使用和拒绝策略

ThreadPoolExecuor的构造方法 先来看一下ThreadPoolExecuor类的构造方法 public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, RejectedExecutionHandler handler) { this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, Executors.defaultThreadFactory(), handler); } 参数说明: ...

Invalid character '=' for QUERY_PARAM in \"MA==\""

spring cloud gateway 请求参数校验比较严格 解决办法重写RouteToRequestUrlFilter类,将未encode的参数值重新encode一下。下面是完整代码,注意 gateway版本(我这spring cloud是Finchley.SR2,spring boot 是Cairo-SR3,spring cloud gateway 2.0.2) /* * Copyright 2013-2017 the original author ...