首页 > 代码库 > 20141104bug

20141104bug

 java.io.NotSerializableException: org.apache.log4j.Logger

public class HbaseCommon implements ConstantFields, Serializable {    private static final long serialVersionUID = -4381143654627578634L;    private final Logger LOG = Logger.getLogger(this.getClass());

log4j没有Serializable接口,在序列化这个类时报:java.io.NotSerializableException: org.apache.log4j.Logger

解决:换成slf4j,因为slf4j实现了序列化接口

    Logger LOG = LoggerFactory.getLogger(HbaseCommon.class);

20141104bug