aspose file tools*
The moose likes Object Relational Mapping and the fly likes Getting  LogConfigurationException while running Hibernate test application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Getting  LogConfigurationException while running Hibernate test application" Watch "Getting  LogConfigurationException while running Hibernate test application" New topic
Author

Getting LogConfigurationException while running Hibernate test application

Srinivas Bonala
Greenhorn

Joined: Feb 14, 2012
Posts: 15
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

    Joined: Jun 25, 2001
    Posts: 15647
        
      15

    This is not JSF. Moving to the Hibernate forum.


    Customer surveys are for companies who didn't pay proper attention to begin with.
    Mark Rucker
    Greenhorn

    Joined: Aug 17, 2012
    Posts: 4
    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
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Getting LogConfigurationException while running Hibernate test application
     
    Similar Threads
    Problem with Lomboz
    Eclipse 3.0, Lomboz 3.0 & Tomcat 5.0.x problem
    JBoss Seam and JasperReports HELP
    Initial SessionFactory creation failed.java.lang.ExceptionInInitializerError
    Unable to start Tomcat from Eclipse