alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
28.01k stars 8.59k forks source link

空指针异常 #2584

Open limingwei opened 6 years ago

limingwei commented 6 years ago

java.lang.NullPointerException at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1386) at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1223) at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4619) at com.alibaba.druid.filter.FilterAdapter.dataSource_getConnection(FilterAdapter.java:2745) at com.alibaba.druid.filter.FilterAdapter$$FastClassBySpringCGLIB$$57d94f6c.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644)

limingwei commented 6 years ago

只有这么多信息了,某一个特定的实例有这个问题,别的实例就没这个问题

limingwei commented 6 years ago

mysql 驱动 5.1.18

limingwei commented 6 years ago

换其他版本的 mysql 驱动,会有其他的问题 可能是这个程序实例或数据库实例有啥特殊的 但不管咋说 NullPointerException 总是值得处理掉的

wenshao commented 6 years ago

druid什么版本?

junzi2099 commented 3 years ago

我也遇到这个问题。定位发现是因为druid配置的initialSize的值大于maxActive的值导致的。