File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Getting LogConfigurationException while running Hibernate test application

Srinivas Bonala

Joined: Feb 14, 2012
Posts: 15

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(
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(
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
at org.apache.commons.logging.LogFactory.getLog(
at org.hibernate.cfg.Configuration.<clinit>(
... 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(
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
... 5 more
Caused by: java.lang.NullPointerException
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
... 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

  • 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: 17410

    This is not JSF. Moving to the Hibernate forum.

    An IDE is no substitute for an Intelligent Developer.
    Mark Rucker

    Joined: Aug 17, 2012
    Posts: 4
    It sounds like log4j can't find your config file. Try some of the things here:

    I agree. Here's the link:
    subject: Getting LogConfigurationException while running Hibernate test application
    It's not a secret anymore!