log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.

多个classloader加载log4j时需要设置当前Thread的classloader为你自己的classloader

Thread.currentThread().setContextClassLoader(classLoader); //for log4j

摘自:org.apache.log4j.helpers.Loader

  /**
   * If running under JDK 1.2 load the specified class using the
   *  <code>Thread</code> <code>contextClassLoader</code> if that
   *  fails try Class.forname. Under JDK 1.1 only Class.forName is
   *  used.
   *
   */
  static public Class loadClass (String clazz) throws ClassNotFoundException {
    // Just call Class.forName(clazz) if we are running under JDK 1.1
    // or if we are instructed to ignore the TCL.
    if(java1 || ignoreTCL) {
      return Class.forName(clazz);
    } else {
      try {
    return getTCL().loadClass(clazz);
      } catch(Throwable e) {
    // we reached here because tcl was null or because of a
    // security exception, or because clazz could not be loaded...
    // In any case we now try one more time
    return Class.forName(clazz);
      }
    }
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [[email protected]40] whereas object of type
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [[email protected]].
log4j:ERROR Could not instantiate appender named "main".
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [[email protected]40] whereas object of type
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [[email protected]].
log4j:ERROR Could not instantiate appender named "console".
log4j:WARN No appenders could be found for logger (com.generallycloud.baseio.component.ssl.SSLUtil).
log4j:WARN Please initialize the log4j system properly.

原文:http://www.cnblogs.com/gifisan/p/6879465.html

时间: 2024-09-30 20:10:13

log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.的相关文章

log4j:ERROR A &quot;org.jboss.logging.appender.FileAppender&quot; object is not assignable to a &quot;org.apache.lo .

log4j:ERROR A "org.jboss.logging.appender.FileAppender" object is not assignable to a "org.apache.lo 标签: log4jobjectjbossjarfile工作 2012-01-15 16:53 2302人阅读 评论(0) 收藏 举报 "org.jboss.logging.appender.FileAppender" object is not assign

log4j:ERROR setFile(null,true) call failed

1.错误描述 log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:221) at java.io.FileOutputStream.<init>(FileOutputStream

Activiti6.0 安装出错 log4j:ERROR setFile(null,true) call failed.

由于要选择一款合适的流程引擎,需要在jbpm和Activiti之间做对比,我这边负责Activiti的测试. 看到Activiti官网(http://www.activiti.org/download.html )9月2号放出了最新的Activiti6,所以打算尝鲜试试,按照其用户手册的2.2节的步骤做了部署,其实也就是把wars目录下的两个war文件拷贝到tomcat的webapps目录下,然后运行tomcat的startup.bat,结果报如下错误: log4j:ERROR setFile(

Fatal error: Using $this when not in object context in C:\AppServ\www\ABC\model\Model.class.php on line 7

原文转发:http://hi.baidu.com/zwnjiejie/blog/item/5e6555c23fa302120ff477dd.html Fatal error Using $this when not in object context in D:\xampp\htdocs\test\php\service\FileCommand.php 大致意思是 $this 没有上下文,原因是没有对此类进行实例化. 出现此错误的原因是:在FileCommand.php中使用 $this->方法

git推送报错: No path specified. See &#39;man git-pull&#39; for valid url syntax或does not appear to be a git repository以及remote: error: insufficient permission for adding an object to repository databa

本地(windows)代码想推送到linux自己搭建的git服务端,第一步是建立本地与服务端的关联,第二步是本地推送到服务端. 第一步需要看你本地工程是否从git上clone来的,如果是clone来的那就不存在第一步了.但如果是本地已经有了工程之后才想同步到git上,需要先到linux的git上新增同名git仓库并初始化.这里以ms-util工程为例: cd git mkdir ms-util.git cd ms-util.git git --bare init 接着修改用户属主和用户组属主,并

Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from http://repo.maven.apache.org/ maven2 was cached in the local repository, resolution will not be reattempted until the update interv

Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from http://repo.maven.apache.org/ maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Origi

Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval o

pom.xml报错: Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are fo

java.lang.NoSuchMethodError: org.apache.tomcat.util.res.StringManager.getManager(Ljava/lang/Class;)Lorg/apache/tomcat/util/res/StringManager

java.lang.NoSuchMethodError: org.apache.tomcat.util.res.StringManager.getManager(Ljava/lang/Class;)Lorg/apache/tomcat/util/res/StringManager 问题: 使用Springboot打包为war部署于Tomcat7中报错 java.lang.NoSuchMethodError: org.apache.tomcat.util.res.StringManager.get

Apache Hadoop YARN: Moving beyond MapReduce and Batch Processing with Apache Hadoop 2

Apache Hadoop YARN: Moving beyond MapReduce and Batch Processing with Apache Hadoop 2 .mobi: http://www.t00y.com/file/79497801 Apache Hadoop YARN: Moving beyond MapReduce and Batch Processing with Apache Hadoop 2.pdf: http://www.t00y.com/file/8034244