java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given

Are you trying to deploy a Spring/Hibernate application and hitting the wall with this exception??

or maybe an exception like the one below ?

I faced this issue while I was working a pet project and found out that it was because some classes were missing a default constructor.

I need to ask a few more questions to make ensure we are on the same page 🙂

  • Do you have a spring bean annotated with @Transactional ? or have configured transactions via the spring config ?
  • Do you have any spring bean which is using AOP in any form ? like logging, security
  • Have you configured your application to use CGLib for proxy generation ?

If you answered Yes to the above questions then read on, if you answered No to any of them then you might its a different problem.

Based on your answers my educated guess is that the beans configured with AOP proxies are missing a default constructor !!

You might have defined a custom constructor and then left out a default no arg constructor.

Define default constructors for all such AOP decorated beans.

Redeploy your application and it should work !!

If this does resolve your issue feel free to drop me a note via the Contact form and I will be happy to help 🙂