4 Replies Latest reply on Jan 20, 2009 12:23 PM by Sai Kumar Munikuntla

    JBoss log4j Update Required?

    Russ Newbie

      I am can not seem to get by this error involving the logging with JBOSS. Presently the TOmCat portion of my application is not logging at ALL. I have server the war file to ensure the log4j and commons-logging jar files are removed, but I am still not able to log from the Web portion.




      [09:25:50,099] [INFO ] [TomcatDeployer] [deploy, ctxPath=/EXPAGWeb, warUrl=.../deploy/EXPAG.ear/EXPAGWeb.war/]
      [09:25:50,849] [ERROR] [STDERR] [log4j:ERROR Could not create an Appender. Reported error follows.]
      [09:25:50,849] [ERROR] [STDERR] [java.lang.ClassCastException: org.jboss.logging.appender.DailyRollingFileAppender cannot be cast to org.apache.log4j.Appender]
      


      My two file appenders:

      1:
       <!-- A time/date based rolling appender -->
       <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
       <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
       <param name="File" value="${jboss.server.log.dir}/server.log"/>
       <param name="Append" value="false"/>
      
       <!-- Rollover at midnight each day -->
       <param name="DatePattern" value="'.'yyyy-MM-dd"/>
      
       <!-- Rollover at the top of each hour
       <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
       -->
      
       <layout class="org.apache.log4j.PatternLayout">
       <!-- The default pattern: Date Priority [Category] Message\n -->
       <param name="ConversionPattern" value="[%d] [%-5p] [%c] [%m]%n"/>
       <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
       <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
       -->
       </layout>
       </appender>
      


      2:

      
       <!-- A time/date based rolling appender -->
       <appender name="MYAPP" class="org.jboss.logging.appender.DailyRollingFileAppender">
       <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
       <param name="File" value="${jboss.server.home.dir}/log/myapp.log"/>
       <param name="Append" value="false"/>
      
      
       <!-- Rollover at midnight each day -->
       <param name="DatePattern" value="'.'yyyy-MM-dd"/>
      
       <!-- Rollover at the top of each hour
       <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
       -->
      
       <layout class="org.apache.log4j.PatternLayout">
       <!-- The default pattern: Date Priority [Category] Message\n -->
       <param name="ConversionPattern" value="[%d][%t] [%5p] [%m]%n"/>
       </layout>
       </appender>
      


      Any recommendations would be greatly appreciated.

      Russ

        • 1. Re: JBoss log4j Update Required?
          Elias Ross Master

          How many log4j.xml files do you have?

          Have you tried switching from the JBoss appender to the stock log4j one?

          • 2. Re: JBoss log4j Update Required?
            Russ Newbie

            JBoss 4.0.5 only used one log4j.xml file on the server.

            • 3. Re: JBoss log4j Update Required?
              Jaime Martin Apprentice

              I am having same problem with JBoss 4.2.2 deploying a seam 2.0.2 GA application. I have only one log4j.xml file
              These are my appenders:

               <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
               <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
               <param name="Target" value="System.out"/>
               <layout class="org.apache.log4j.PatternLayout">
               <!-- The default pattern: Date Priority [Category] Message\n -->
               <param name="ConversionPattern" value="%-5p [%c{6}] %m%n"/>
               </layout>
               </appender>
              
              
               <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
               <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
               <param name="File" value="${jboss.server.log.dir}/server.log"/>
               <param name="Append" value="false"/>
              
               <!-- Rollover at midnight each day -->
               <param name="DatePattern" value="'.'yyyy-MM-dd"/>
              
               <!-- Rollover at the top of each hour
               <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
               -->
              
               <layout class="org.apache.log4j.PatternLayout">
               <!-- The default pattern: Date Priority [Category] Message\n -->
               <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
              
               <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
               <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
               -->
               </layout>
               </appender>
              


              CONSOLE appender works ok, but FILE appender causes this exception:
              09:38:44,234 ERROR [STDERR] java.lang.ClassCastException: org.jboss.logging.appender.RollingFileAppender cannot be cast to org.apache.log4j.Appender
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:175)
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:150)
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:163)
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:425)
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:394)
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:829)
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:712)
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:618)
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:470)
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
              09:38:44,234 ERROR [STDERR] at org.apache.log4j.Logger.getLogger(Logger.java:104)
              09:38:44,234 ERROR [STDERR] at org.jboss.seam.log.Log4JProvider.<init>(Log4JProvider.java:31)
              09:38:44,234 ERROR [STDERR] at org.jboss.seam.log.Logging.getLogProvider(Logging.java:43)
              09:38:44,234 ERROR [STDERR] at org.jboss.seam.log.Logging.getLogProvider(Logging.java:50)
              09:38:44,234 ERROR [STDERR] at org.jboss.seam.servlet.SeamListener.<clinit>(SeamListener.java:28)
              09:38:44,234 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              09:38:44,234 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
              09:38:44,234 ERROR [STDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
              09:38:44,234 ERROR [STDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
              09:38:44,234 ERROR [STDERR] at java.lang.Class.newInstance0(Class.java:355)
              09:38:44,234 ERROR [STDERR] at java.lang.Class.newInstance(Class.java:308)
              09:38:44,234 ERROR [STDERR] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3800)
              09:38:44,234 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
              09:38:44,234 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
              09:38:44,234 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
              09:38:44,234 ERROR [STDERR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
              09:38:44,234 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              09:38:44,234 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              09:38:44,234 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              09:38:44,234 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              09:38:44,234 ERROR [STDERR] at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              09:38:44,234 ERROR [STDERR] at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
              09:38:44,234 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              09:38:44,234 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              09:38:44,234 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              09:38:44,234 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              09:38:44,234 ERROR [STDERR] at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              09:38:44,234 ERROR [STDERR] at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
              09:38:44,234 ERROR [STDERR] at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
              09:38:44,234 ERROR [STDERR] at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
              09:38:44,234 ERROR [STDERR] at org.jboss.web.WebModule.startModule(WebModule.java:83)
              09:38:44,234 ERROR [STDERR] at org.jboss.web.WebModule.startService(WebModule.java:61)
              09:38:44,234 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
              09:38:44,234 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
              09:38:44,234 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
              09:38:44,234 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              09:38:44,234 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              09:38:44,234 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
              09:38:44,234 ERROR [STDERR] at $Proxy0.start(Unknown Source)
              09:38:44,234 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:417)
              09:38:44,234 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
              09:38:44,234 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              09:38:44,234 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
              09:38:44,234 ERROR [STDERR] at $Proxy44.start(Unknown Source)
              09:38:44,234 ERROR [STDERR] at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
              09:38:44,234 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              09:38:44,234 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              09:38:44,234 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              09:38:44,234 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
              09:38:44,234 ERROR [STDERR] at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
              09:38:44,234 ERROR [STDERR] at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
              09:38:44,234 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
              09:38:44,234 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
              09:38:44,234 ERROR [STDERR] at $Proxy45.start(Unknown Source)
              09:38:44,234 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
              09:38:44,234 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
              09:38:44,234 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
              09:38:44,234 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
              09:38:44,234 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              09:38:44,234 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
              09:38:44,234 ERROR [STDERR] at $Proxy9.deploy(Unknown Source)
              09:38:44,234 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
              09:38:44,234 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
              09:38:44,234 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
              09:38:44,234 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
              09:38:44,234 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
              09:38:44,234 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
              09:38:44,234 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
              09:38:44,234 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              09:38:44,234 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              09:38:44,234 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
              09:38:44,234 ERROR [STDERR] at $Proxy0.start(Unknown Source)
              09:38:44,234 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:417)
              09:38:44,234 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
              09:38:44,234 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              09:38:44,234 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              09:38:44,234 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
              09:38:44,250 ERROR [STDERR] at $Proxy4.start(Unknown Source)
              09:38:44,250 ERROR [STDERR] at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
              09:38:44,250 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
              09:38:44,250 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
              09:38:44,250 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
              09:38:44,250 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
              09:38:44,250 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              09:38:44,250 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              09:38:44,250 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              09:38:44,250 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              09:38:44,250 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
              09:38:44,250 ERROR [STDERR] at $Proxy5.deploy(Unknown Source)
              09:38:44,250 ERROR [STDERR] at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
              09:38:44,250 ERROR [STDERR] at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
              09:38:44,250 ERROR [STDERR] at org.jboss.Main.boot(Main.java:200)
              09:38:44,250 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:508)
              09:38:44,250 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
              09:38:44,250 ERROR [STDERR] log4j:ERROR Could not parse url [file:/C:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/default/deploy/PRR_ONLINEV2.war/WEB-INF/classes/log4j.xml].
              09:38:44,250 ERROR [STDERR] java.lang.NullPointerException
              
              


              any idea? thank you in advance!

              • 4. Re: JBoss log4j Update Required?
                Sai Kumar Munikuntla Newbie

                T 11-5 log4j:ERROR A "XYZAppender" object is not assignable to a "org.apache.log4j.Appender" variable.

                This error occurs when log4j classes are loaded into memory by two distinct class loaders. According to section 4.3.4 of the Java Language Specification, when the same class is loaded by different class loaders, the resulting runtime copies are con-sidered incompatible.

                While processing configuration scripts, log4j configurators often load classes into memory. Log4j is programmed such that configurators will first attempt load a re-quired class using the thread context class loader (TCL) and if that fails, it will at-tempt to load the class using the current class loader. Thus, log4j configurators will fail to load appenders or other log4j components when the thread context class loader has a different copy of log4j classes than the copy loaded by the current class loader. For example, assuming class loaders A and B both load a copy of log4j classes and the TCL is set to point to B, then invoking the configure method of a DOMConfigurator instance loaded by class loader A will cause an error. Indeed, the method responsible for loading the appender into memory will check that the class of the appender is assignable to org.apache.log4j.Appender. The check is done against the org.apache.log4j.Appender class loaded by A but since log4j gives preference to loading classes through the thread context class loader, B in this case, the Java runtime will consider the new appender (loaded by B) incom-patible with the copy of org.apache.log4j.Appender class loaded by A.

                To get around this problem it suffices to make sure that only one and only one copy of log4j.jar is available to the class loader hierarchy of your application. This is not always possible because certain servlet containers and EJB containers use log4j in-ternally for their own logging. These containers usually ship with a copy of log4j.jar which is visible by certain parts of their class loader hierarchy. However, when users deploy
                log4j.jar within their web-applications or ear files, depending on the delegation model of the application-specific class loaders as well as the TCL settings, con-flicts can arise. Tracking these conflicts requires good understanding of the class loader hierarchy of the container as well as precise details about the deployment of jar files at user premises. It is not always possible to obtain accurate and timely in-formation on these matters.

                When all attempts to resolve the aforementioned problem fail despite your best ef-forts, then you can set the "log4j.ignoreTCL" system property as a last ditch solu-tion. When this system property is set to any value other than "false," log4j's class loading algorithm will ignore the value of the thread context loader and will only use the current class loader in order to locate and load classes. Note that the "log4j.ignoreTCL" property is only available in log4j version 1.2.6 and later. It is a system property that cannot be specified within configuration files.