原因: 没引入log4j包
maven项目,pom.xml 添加
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>compile</scope>
</dependency>
如果不是maven项目的话,需要自己去下载log4j的jar包导入到项目中.