1 Reply Latest reply on Mar 26, 2007 5:40 PM by Paul Risenhoover

    Classloading problem while migrating from jboss 4.0.3 to jbo

    meissa sakho Newbie

      Hi all,

      I'v troubles while trying to deploy my application in jboss 4.0.5.

      I've got the errors belows.

      log4j:ERROR A "org.jboss.logging.util.OnlyOnceErrorHandler" object is not assignable to a "org.apache.log4j.spi.ErrorHandler" variable.
      log4j:ERROR The class "org.apache.log4j.spi.ErrorHandler" was loaded by
      log4j:ERROR [org.jboss.mx.loading.UnifiedClassLoader3@8c048e{ url=file:/D:/Documents/developpements/workspace/nis_portail_ear/deploy/portail_ear.ear/ ,addedOrder=48}] whereas object of type
      log4j:ERROR "org.jboss.logging.util.OnlyOnceErrorHandler" was loaded by [org.jboss.system.server.NoAnnotationURLClassLoader@1a33d48].
      log4j:ERROR Could not create an Appender. Reported error follows.
      java.lang.ClassCastException: org.jboss.logging.appender.DailyRollingFileAppender

      The same application is well deployed in jboss 4.0.3
      It seems there is a change in jboss classloading beween the two versions.
      I don't want to remove log4j.jar from my application librairies.
      Can someone tells how to get rid off this kind of problem.

      thank in advance.
      Meissa

        • 1. Re: Classloading problem while migrating from jboss 4.0.3 to
          Paul Risenhoover Newbie

          My advice is, unless you have some specific reason, remove the log4j.jar files from your application libraries.

          I've set up a special lib directory into which I put all the jar files that my application needs that jboss has -- and I compile against that. But I don't put any of those jars in the final WEB-INF/lib directory. I depend on the classloader to pull them from Jboss at run-time.

          I can assure you that I've had dozens of odd problems that were fixed by slimming my WEB-INF/lib directory.

          Good luck.