maven依赖文件如下:
<dependencies>
<!-- <dependency>
<groupId>io.druid</groupId>
<artifactId>druid-server</artifactId>
<version>0.9.1.1</version>
</dependency>
<dependency>
<groupId>io.druid</groupId>
<artifactId>druid-api</artifactId>
<version>0.9.1.1</version>
</dependency>
-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.18</version>
</dependency>
<dependency>
<groupId>org.nutz</groupId>
<artifactId>nutz</artifactId>
<version>1.r.57</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.2</version>
</dependency>
</dependencies>
此时就会报各种阿里哪个库的错。不晓得为何,但是不通过maven的话,就只报一个
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
九月 19, 2016 4:10:48 下午 com.alibaba.druid.pool.vendor.MySqlValidConnectionChecker warn
警告: Cannot resolve com.mysq.jdbc.Connection.ping method. Will use 'SELECT 1' instead.
java.lang.NullPointerException
at com.alibaba.druid.pool.vendor.MySqlValidConnectionChecker.<init>(MySqlValidConnectionChecker.java:50)
at com.alibaba.druid.pool.DruidDataSource.initValidConnectionChecker(DruidDataSource.java:944)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:659)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.nutz.ioc.trigger.MethodEventTrigger.trigger(MethodEventTrigger.java:18)
at org.nutz.ioc.weaver.DefaultWeaver.onCreate(DefaultWeaver.java:72)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:75)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:265)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:150)
at com.nutz.module.MainSetup.init(MainSetup.java:18)
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:276)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120)
at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5633)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
九月 19, 2016 4:10:48 下午 com.alibaba.druid.pool.DruidDataSource info
信息: {dataSource-1} inited