Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Propagation of exceptions in Spring Boot

 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
does Spring Boot wraps/hides/encapsulates exceptions one way or another ?
I get some strange behaviour when an exception is produced.
For instance, in a Spring Boot + JPA project, if i comment out the @Entity annotation

i get the following exception (warning) :

So the exception says the application is unable to build a Hibernate SessionFactory but it does not point out precisely where the problem comes from.

Any clue ?
Thanks
 
author
Posts: 422
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would appear that Spring is hiding the details of this exception, but probably not for sinister reasons.

Under the covers Spring will instantiate Hibernate components. In the course of doing so, Hibernate will try to make sense of the mappings on its entities. In this case (it's a little difficult to read given how the forum formats those log lines) it appears to be attempting to make sense of another entity that has a reference to Contract (which is not an entity) and so Hibernate complains. Since it's Spring that's creating that Hibernate component, any Hibernate exceptions get caught up in the middle of the bean creation and rethrown as bean creation exceptions. (Again, that's my diagnosis based on the difficult to read forum-formatted log lines.)

Celinio Fernandes wrote:Hi,
does Spring Boot wraps/hides/encapsulates exceptions one way or another ?
I get some strange behaviour when an exception is produced.
For instance, in a Spring Boot + JPA project, if i comment out the @Entity annotation

i get the following exception (warning) :

So the exception says the application is unable to build a Hibernate SessionFactory but it does not point out precisely where the problem comes from.

Any clue ?
Thanks

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic