Announcement Announcement Module
Collapse
No announcement yet.
How to verbose log Spring problems like "Unable to build EntityManagerFactory"? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment

    Working...
    X