1 Reply Latest reply on Jul 30, 2012 8:52 AM by Joseph Barrow

    Class instantiation/not found exception error with OnlyOnceErrorHandler in log4j

    Joseph Barrow Newbie

      Hello,

       

      I am currently trying to migrate an older WAR project in Eclipse to the JBoss 6 EAP and have run into a very frustrating error.  The error, as the title says, occurs with the org.jboss.logging.util.OnlyOnceErrorHandler class and specifically it says that the class is not found in my local modules folder.  In attempts to fix the issue I have

       

      1) Tried removing the log4j,jar and commons-logging.jar files from the war itself, as per the suggestions of others having similar problems.

      2) Modified the log4j.xml file (posted below the error code) so that the errorhandler for the appender does not include util in its path, I did this thinking a new structure had been implemented

       

      The project is currently running from a standalone server deployment.  As a note for change #2 above, I did find that removing the .util from the string did not change anything and I believe that the error lies within the org.jboss.log4j.logmanager:main directory.  My main question is what is this error really telling me and what are the suggested fixes for it?

       

       

       

      [Error Code From Eclipse Console]

       

      09:17:04,065 ERROR [stderr] (MSC service thread 1-5) log4j:ERROR Could not instantiate class [org.jboss.logging.util.OnlyOnceErrorHandler].

      09:17:04,065 ERROR [stderr] (MSC service thread 1-5) java.lang.ClassNotFoundException: org.jboss.logging.util.OnlyOnceErrorHandler from [Module "org.jboss.log4j.logmanager:main" from local module loader @892b7c2 (roots: /Users/jbarrow/DevWebServers/jboss-eap-6.0/modules)]

      09:17:04,066 ERROR [stderr] (MSC service thread 1-5)           at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

      09:17:04,066 ERROR [stderr] (MSC service thread 1-5)           at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

      09:17:04,066 ERROR [stderr] (MSC service thread 1-5)           at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

      09:17:04,067 ERROR [stderr] (MSC service thread 1-5)           at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

      09:17:04,067 ERROR [stderr] (MSC service thread 1-5)           at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

      09:17:04,067 ERROR [stderr] (MSC service thread 1-5)           at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

      09:17:04,067 ERROR [stderr] (MSC service thread 1-5)           at java.lang.Class.forName0(Native Method)

      09:17:04,067 ERROR [stderr] (MSC service thread 1-5)           at java.lang.Class.forName(Class.java:169)

      09:17:04,068 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.helpers.Loader.loadClass(Loader.java:198)

      09:17:04,068 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:326)

      09:17:04,068 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.xml.DOMConfigurator.parseErrorHandler(DOMConfigurator.java:315)

      09:17:04,068 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:276)

      09:17:04,068 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)

      09:17:04,069 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)

      09:17:04,069 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)

      09:17:04,069 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436)

      09:17:04,070 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:999)

      09:17:04,070 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:867)

      09:17:04,070 ERROR [stderr] (MSC service thread 1-5)           at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:794)

      09:17:04,070 ERROR [stderr] (MSC service thread 1-5)           at org.jboss.as.logging.LoggingConfigurationProcessor.deploy(LoggingConfigurationProcessor.java:111)

      09:17:04,071 ERROR [stderr] (MSC service thread 1-5)           at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116)

      09:17:04,071 ERROR [stderr] (MSC service thread 1-5)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

      09:17:04,071 ERROR [stderr] (MSC service thread 1-5)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

      09:17:04,071 ERROR [stderr] (MSC service thread 1-5)           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

      09:17:04,072 ERROR [stderr] (MSC service thread 1-5)           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

      09:17:04,072 ERROR [stderr] (MSC service thread 1-5)           at java.lang.Thread.run(Thread.java:680)

       

       

       

      [XML code that references this class]

       

         <appender name="FILE" class="org.apache.log4j.RollingFileAppender">

              <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>

              <param name="File" value="${jboss.server.log.dir}/server.log"/>

              <param name="Append" value="true"/>

              <param name="MaxFileSize" value="25MB"/>

              <param name="MaxBackupIndex" value="5"/>

              <layout class="org.apache.log4j.PatternLayout">

                  <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>

              </layout>

         </appender>