会和我的MYSQL 驱动 版本有关系嘛? 这个老项目里 用的是 3.1
DaoUp.me().init("nutzdb.properties");
Dao dao = DaoUp.me().dao();
Record re = dao.fetch("mx_user_register", Cnd.where("uid","=",106));
System.out.println(re.getInt("uid"));
DaoUp.me().close();
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://192.168.12.216:3306/db_8082_user
username=root
password=root
java.lang.NullPointerException
at com.alibaba.druid.pool.vendor.MySqlValidConnectionChecker.(MySqlValidConnectionChecker.java:50)
at com.alibaba.druid.pool.DruidDataSource.initValidConnectionChecker(DruidDataSource.java:892)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:608)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:934)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:930)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:102)
at org.nutz.trans.Trans.getConnectionAuto(Trans.java:263)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:106)
at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:174)
at org.nutz.dao.impl.NutDao.(NutDao.java:112)
at org.nutz.dao.util.DaoUp.setDataSource(DaoUp.java:131)
at org.nutz.dao.util.DaoUp.init(DaoUp.java:189)
at org.nutz.dao.util.DaoUp.init(DaoUp.java:170)
at org.nutz.dao.util.DaoUp.init(DaoUp.java:149)
at com.framework.server.backend.user.dao.impl.UserDaoImpl.main(UserDaoImpl.java:1984)
10:20:31,857 [main] INFO DruidDataSource:669 - {dataSource-1} inited
10:20:32,204 [Druid-ConnectionPool-Create-2034590940] ERROR DruidDataSource:1883 - create connection error, url: jdbc:mysql://192.168.12.216:3306/db_8082_user
java.sql.SQLException: validateConnection false
java.lang.RuntimeException: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 15000, active 0, maxActive 8
at org.nutz.lang.Lang.wrapThrow(Lang.java:149)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:113)
at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:174)
at org.nutz.dao.impl.NutDao.(NutDao.java:112)
at org.nutz.dao.util.DaoUp.setDataSource(DaoUp.java:131)
at org.nutz.dao.util.DaoUp.init(DaoUp.java:189)
at org.nutz.dao.util.DaoUp.init(DaoUp.java:170)
at org.nutz.dao.util.DaoUp.init(DaoUp.java:149)
at com.framework.server.backend.user.dao.impl.UserDaoImpl.main(UserDaoImpl.java:1984)
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 15000, active 0, maxActive 8
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1137)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:960)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:940)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:930)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:102)
at org.nutz.trans.Trans.getConnectionAuto(Trans.java:263)
at org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:106)
... 7 more
Caused by: java.sql.SQLException: validateConnection false
at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1227)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1450)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1881)
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:838]