Results 1 to 2 of 2

Thread: How to verbose log Spring problems like "Unable to build EntityManagerFactory"?

  1. #1
    Join Date
    Aug 2010
    Posts
    7

    Default How to verbose log Spring problems like "Unable to build EntityManagerFactory"?

    In a Java program with Hibernate and SpringJPA I get occasionally odd error messages like:

    "Exception during loading of ApplicationContextorg.springframework.beans.factor y.BeanCreationException:
    Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext-datasource.xml]:
    Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: testADD]
    Unable to build EntityManagerFactory"

    This message is not really helpful (The real reason was a missing Annotation).

    So I am searching for a general way to log/output a much more verbose output of Spring.

    How can I achieve this?

    Can I use log4j?

    What EXACTLY do I have to specify here?

    How else can I force Spring to be more helpful for error search?

    Peter

  2. #2
    Join Date
    Dec 2010
    Location
    Singapore
    Posts
    287

    Post

    You can specify the spring framework (or any other api) logger level to debug inside the log4j.xml

    Code:
    <logger name="org.springframework">
           <level value="debug" />
    </logger>
    http://springett.blogspot.com/2008/0...-template.html
    Amila Domingo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •