11

I am trying to run a basic Hibernate program. When I run it, I am getting the below error

java.lang.NoClassDefFoundError: org/jboss/logging/BasicLogger

I tried google'ing for it and did include the following jar files in my classpath :-

  • jboss-common-3.2.3.jar
  • jboss-common-client-3.2.3.jar

Am I missing some more jar file ?

Thanks


EDIT :

I did include the following jar file inside classpath :-

  • jboss-logging-3.1.0.CR1.jar

But, Facing the error:

java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Lj‌​ava/lang/Object
Daemon
  • 167
  • 3
  • 3
  • 13
  • 1
    did you include the necessary classes in your code? – bcr Sep 27 '12 at 06:43
  • The `NoSuchMethodError` means that you most likely are trying to run this with a different version of the JAR file than what you compiled it with. Make sure you use the same version of the JAR when compiling and when running your program. – Jesper Sep 27 '12 at 07:19

4 Answers4

15

Yes jboss-logging.jar org/jboss/logging/BasicLogger is inside jboss-logging.jar

You can find list of dependent jar for this jar in used by section in this link.

This version should contain the method.

catch23
  • 17,519
  • 42
  • 144
  • 217
Amit Deshpande
  • 19,001
  • 4
  • 46
  • 72
  • Thanks, that did resolved that error. But it's not giving me another error .. java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object; – Daemon Sep 27 '12 at 06:49
  • 1
    You can find more info on [How to create a simple EJB3 project in Eclipse (JBoss 7.1)](http://theopentutorials.com/examples/java-ee/ejb3/how-to-create-a-simple-ejb3-project-in-eclipse-jboss-7-1/). You will also find list of dependent jars over there. – Amit Deshpande Sep 27 '12 at 07:07
  • to **resolve all those dependencies in a standalone (non-container-managed) environment** it may help to just download a hibernate release from here: http://hibernate.org/orm/downloads/ and add all the jars from under **`hibernate-release-*-Final/lib/required/*.jar`** (e.g. 9 jars for 4.3.7) – Andreas Covidiot Dec 15 '14 at 11:20
  • (of course depending on what you are doing, further libs may be required or "/required/*.jar" ones may not be required for your specific scenario) – Andreas Covidiot Dec 15 '14 at 11:44
4

You need jboss-logging.jar

You can get it from here

gprathour
  • 14,813
  • 5
  • 66
  • 90
  • Getting this error now ..java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Lj‌​ava/lang/Object; – Daemon Sep 27 '12 at 06:49
1

If those files already exist, try adding them to your Java Build Path. You can use this as reference: Java Build Path

Community
  • 1
  • 1
Russell Gutierrez
  • 1,372
  • 8
  • 19
1

To solve

 java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Lj‌​ava/lang/Object

use the JAR file (jboss-client-7.1.0.Final.jar) this will help you to solve solve your error

thar45
  • 3,518
  • 4
  • 31
  • 48
  • I tried google'ing that jar but couldn't find the link. Can you pls provide me with d/w link ? – Daemon Sep 27 '12 at 07:01