Hibernate 4.0.1 Final and Jenkins 1.449 java.lang.NoSuchFieldError: TRACE

Using Hibernate 4.0.1 Final within a Jenkins plugin causes the error below. This is because Jenkins ships with log4j 1.2.9 and Hibernate requires 1.2.16

Replace the old jar with the new in {jenkins_home}/WEB-INF/lib and Hibernate will work.

java.lang.NoSuchFieldError: TRACE
	at org.jboss.logging.Log4jLogger.translate(Log4jLogger.java:64)
	at org.jboss.logging.Log4jLogger.doLog(Log4jLogger.java:44)
	at org.jboss.logging.Logger.trace(Logger.java:128)
	at org.hibernate.ejb.internal.EntityManagerMessageLogger_$logger.trace(EntityManagerMessageLogger_$logger.java:422)
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:322)
	at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
	...
        Your classes
        ...
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
	at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:700)
	at hudson.model.Build$RunnerImpl.build(Build.java:178)
	at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
	at hudson.model.Run.run(Run.java:1404)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:238)
This entry was posted in Programming and tagged , , . Bookmark the permalink.

One Response to Hibernate 4.0.1 Final and Jenkins 1.449 java.lang.NoSuchFieldError: TRACE

  1. shashidhar says:

    i am getting the same error using 4.1.9 and i have included log4j 1.2.16 also but getting still getting the same error.

    Exception in thread “main” java.lang.NoSuchFieldError: TRACE
    [java] at org.jboss.logging.Log4jLogger.translate(Log4jLogger.java:64)
    [java] at org.jboss.logging.Log4jLogger.isEnabled(Log4jLogger.java:39)
    [java] at org.jboss.logging.Logger.logv(Logger.java:1953)
    [java] at org.hibernate.internal.CoreMessageLogger_$logger.tracev(CoreMessageLogger_$logger.java:447)

Leave a Reply

Your email address will not be published. Required fields are marked *