In Spring Boot, when you try to create a Swing frame from the component that is the entry point of your app, you will get
Caused by: java.awt.HeadlessException
To solve this, in your Application class in main, instead of:
SpringApplication.run (Application.class, args)
use
SpringApplicationBuilder builder = new SpringApplicationBuilder(Application.class); builder.headless(false); ConfigurableApplicationContext context = builder.run(args);
Great! thanks man!
LikeLike
Thank you. This works 100’s
LikeLike
Thank you so much! The first source that helped me with that issue! Cheers
LikeLike
Sir, you have my gratitude!!
LikeLike
Even SpringBuilder headless is decalared as false , still i get same exception .Caused by: java.awt.HeadlessException: null .. Researched a lot but no luck
LikeLike
Thank you so much, it solved my issue. 🙂
LikeLike
You’re welcome.
LikeLike
Maaaaaaan Thank you so Much !!!!!!
LikeLiked by 1 person
Thank you. Its working for me.
LikeLike
after handling this exception in application it’s working but making war file and deploying in external server it’s getting same exception so how to handle this exception in this situation
LikeLike
Thanks a lot, man!
LikeLike