3
votes

I am developing a project which accesses the database on local, and then calls remote EJB service in a JBoss AP server.

Therefore, I use the hibernate-release-4.1.5.Final for the hibernate and jbossall-client.jar for calling the remote EJB services.

However, when running jndiContext.lookup("xxx") method, an exception bumps out, and the messages shows as below.

Exception in thread "main" 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.isTraceEnabled(Logger.java:98)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:623)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:590)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)

I've tried and found out the jboss-logging-3.1.0.GA.jar of Hibernate framework will conflict with the jbossall-client.jar.
If this jar is excluded, the EJB works successfully, but the hibernate parts will not work.

I am curios whether this exception results from the difference of the versions between Log4J of jboss-logging-3.1.0.GA.jar and one of jbossall-client.jar.

The jars I put in my project are listed as below.
1.antlr-2.7.7.jar
2.dom4j-1.6.1.jar
3.hibernate-commons-annotations-4.0.1.Final.jar
4.hibernate-core-4.1.5.Final.jar
5.hibernate-jpa-2.0-api-1.0.1.Final.jar
6.javassist-3.15.0-GA.jar
7.jboss-logging-3.1.0.GA.jar
8.jboss-transaction-api_1.1_spec-1.0.0.Final.jar
9.jbossall-client.jar

JDK:jdk1.6.0_25

Could any one please give me a suggestion or a solution? If there is any information needed, please feel free to tell me.

Thanks for your helps in advance.

1
What's the version of your log4j jar file?Jon Lin
Hi Jon, I use the default jar only. One in jboss-logging-3.1.0.GA.jar, another in jbossall-client.jar.Roden

1 Answers

6
votes

Try grabbing a newer version of log4j, hibernate 4 needs (I think) 1.2.12 or higher. You may need to put it in your server's lib directory. If that doesn't work, you may need to use hibernate 3 instead.