'java.lang.NoSuchFieldError: TRACE while using hibernate 4.1.8.Final version

I am getting the following error when I run my Spring+hibernate app on Windows 7.

Caused by: java.lang.NoSuchFieldError: TRACE
        at org.jboss.logging.Log4jLogger.translate(Log4jLogger.java:64)
        at org.jboss.logging.Log4jLogger.isEnabled(Log4jLogger.java:39)
        at org.jboss.logging.Logger.logv(Logger.java:1953)
        at org.hibernate.internal.CoreMessageLogger_$logger.tracev(CoreMessageLogger_$logger.java:443)
        at org.hibernate.cfg.EJB3DTDEntityResolver.resolveEntity(EJB3DTDEntityResolver.java:58)
        at com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:110)

I am using 4.1.8.Final version based on MVN. I read some where that log4j should be GT 1.2.12, so I am using 1.2.17, but the problem still exists.

My main problem is the same code is running fine on windows XP. Can anyone help me...



Solution 1:[1]

You have a problem with the log4j version

    private static org.apache.log4j.Level translate(final Level level) {
    if (level != null) switch (level) {
        case FATAL: return org.apache.log4j.Level.FATAL;
        case ERROR: return org.apache.log4j.Level.ERROR;
        case WARN:  return org.apache.log4j.Level.WARN;
        case INFO:  return org.apache.log4j.Level.INFO;
        case DEBUG: return org.apache.log4j.Level.DEBUG;
        case TRACE: return org.apache.log4j.Level.TRACE;
    }
    return org.apache.log4j.Level.ALL;
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 xjodoin