• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting LogConfigurationException while running Hibernate test application

 
Srinivas Bonala
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i created a sample java application in eclipse. eclipse version is eclipse-jee-indigo-SR2-win32.

I wrote all the hibernate configuration and mapping files. But when am running the class the following exception came.

Exception in thread "main" java.lang.ExceptionInInitializerError
at com.sample.modal.SampleModal.main(SampleModal.java:9)
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException) (Caused by org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:116)
... 1 more
Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
... 5 more
Caused by: java.lang.NullPointerException
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:374)
... 6 more



The code below i used for configure the sessionFactory and to get the session object.



I added the following jar files into the classpath.
  • antlr-2.7.6
    asm
    cglib-2.1.3
    commons-collections-3.1
    commons-logging-1.0.4
    dom4j-1.6.1
    ehcache-1.1
    hibernate3
    jta
    log4j-1.2.16


  • Can anyone helping me how to trace this exception. and Please let me know if i missed anything...
    thanks in advance...
     
    Tim Holloway
    Saloon Keeper
    Pie
    Posts: 18226
    53
    Android Eclipse IDE Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    This is not JSF. Moving to the Hibernate forum.
     
    Mark Rucker
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    It sounds like log4j can't find your config file. Try some of the things here: http://www.eclipsezone.com/eclipse/forums/t77212.html.

    Mark
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic